Skip to content

Releases: ChenYilong/CYLTabBarController

CYLTabBarController v1.29.0版本 修复分割线和Lottie动画播放异常等bugs

07 May 11:04
Compare
Choose a tag to compare



今天把 CYLTabBarController 更新到1.29.0, 修了几个issue, 主要是顶部导航栏,
主要修复的功能:

  • TabBar 自定义分割线
  • 隐藏 TabBar 分割线的方法

将更新的代码贴一下:

TabBar 自定义分割线

// NO.1,using Image note:recommended.推荐方式
   // set the bar shadow image
   // without shadow : use -[[CYLTabBarController hideTabBarShadowImageView] in CYLMainRootViewController.m
   if (@available(iOS 13.0, *)) {
       UITabBarItemAppearance *inlineLayoutAppearance = [[UITabBarItemAppearance  alloc] init];
       // set the text Attributes
       // 设置文字属性
       [inlineLayoutAppearance.normal setTitleTextAttributes:normalAttrs];
       [inlineLayoutAppearance.selected setTitleTextAttributes:selectedAttrs];
   
       UITabBarAppearance *standardAppearance = [[UITabBarAppearance alloc] init];
       standardAppearance.stackedLayoutAppearance = inlineLayoutAppearance;
       standardAppearance.backgroundColor = [UIColor cyl_systemBackgroundColor];
       standardAppearance.shadowImage = [[self class] imageWithColor:[UIColor cyl_systemGreenColor] size:CGSizeMake([UIScreen mainScreen].bounds.size.width, 1)];
       self.tabBar.standardAppearance = standardAppearance;
   } else {
       // Override point for customization after application launch.
       // set the text Attributes
       // 设置文字属性
       UITabBarItem *tabBar = [UITabBarItem appearance];
       [tabBar setTitleTextAttributes:normalAttrs forState:UIControlStateNormal];
       [tabBar setTitleTextAttributes:selectedAttrs forState:UIControlStateSelected];
       
//        // This shadow image attribute is ignored if the tab bar does not also have a custom background image.So at least set somthing.
       [[UITabBar appearance] setBackgroundImage:[[UIImage alloc] init]];
       [[UITabBar appearance] setShadowImage:[[self class] imageWithColor:[UIColor cyl_systemGreenColor] size:CGSizeMake([UIScreen mainScreen].bounds.size.width, 1)]];
   }

可以使用:

v1.29.0 更新了内部实现, 兼容了 iOS13+ ,和 iOS13- 版本.

-[[CYLTabBarController hideTabBarShadowImageView] 

其中重要的部分在于找到分割线对应的 View, 实现方法如下:

- (UIImageView *)cyl_tabShadowImageView {
   if (@available(iOS 10.0, *)) {
       //iOS10及以上这样获取ShadowImageView:
       UIView *subview = [self cyl_tabBackgroundView];
       if (!subview) {
           return nil;
       }
       NSArray<__kindof UIView *> *backgroundSubviews = subview.subviews;
       //iOS13系统backgroundSubviews.count > 1可行,12及以下就不可行了
       if (backgroundSubviews.count >= 1) {
           for (UIView *subview in backgroundSubviews) {
               if (CGRectGetHeight(subview.bounds) <= 1.0 ) {
                   return (UIImageView *)subview;
               }
           }
       }
   } else {
       //iOS9这样获取ShadowImageView:
       for (UIView *subview in self.subviews) {
           if (CGRectGetHeight(subview.bounds) <= 1.0 ) {
               return (UIImageView *)subview;
           }
       }
   }
   return nil;
}

隐藏 TabBar 分割线的方法

Lottie 动画在某些场景不播放的问题

详情参见 #423 issue.

fix issues:
#431
#436
#492
#423

项目地址: https://github.com/ChenYilong/CYLTabBarController

[CN]一行代码支持Lottie动画TabBar样式 [EN] It only needs one line of code to have an animated TabBar with Lottie.

22 Apr 08:09
Compare
Choose a tag to compare

[CN]一行代码支持Lottie动画TabBar样式
[EN] It only needs one line of code to have an animated TabBar with Lottie.
详情见:#341

增加API支持动态用图片替换TabBarButton或者SwappableImageView,轻松实现类淘宝首页效果

12 Apr 10:39
Compare
Choose a tag to compare

Add new API to remove PlusButton dynamically

12 Apr 10:40
Compare
Choose a tag to compare

增加API,支持动态移除PlusButton

更改小红点实现方式,并增加多个API自定义红点UI样式、动画效果。

06 Mar 10:23
Compare
Choose a tag to compare

v1.19.0更改小红点实现方式,并增加多个API自定义红点UI样式、动画效果。请更新重试。相关API展示在CYLBadgeProtocol.h 中
效果图:
enter image description here

[work-arounds]compatible for iPhoneX for issue #312

05 Nov 14:04
Compare
Choose a tag to compare

v1.17.21 [work-arounds]compatible for iPhoneX for issue #312

work-arounds 方案,解决 iOS12.1上,iPhoneX 位置跳动的问题。

fix iPad tabbar item select bug

26 Oct 07:27
Compare
Choose a tag to compare

修复iPad上,如果有PlusViewController 后 tabbar item选择异常的问题

fix ios 11 UITabBar UITabBarItem positioning issue

26 Oct 07:28
Compare
Choose a tag to compare

禁止iPad上,tabbar item 按钮,image和title行向排布,保持与iPhone上一致的排布

v1.17.18 fix iOS12.1 UINavigationController + UITabBarController + popViewControllerAnimated bug

26 Oct 07:30
Compare
Choose a tag to compare

【change log】CYLTabBarController v1.17.18 修复了iOS12.1 bate版本中遇到的问题。问题描述:设置hidesBottomBarWhenPushed后,pop到上个页面,会出现 tabBar 布局错乱的问题。 用系统UINavigationController + UITabBarController 一样会遇到这个问题,目前已经在CYLTabBarController新版本中绕过。库的使用方法不变,只需要更新库即可。

#312

update new feature red point 增加红点角标功能

15 Jun 01:13
Compare
Choose a tag to compare
1.13.0

update new feature red point