ChenYilong / CYLTabBarController

[EN]It is an iOS UI module library for adding animation to iOS tabbar items and icons with Lottie, and adding a bigger center UITabBar Item. [CN]【中国特色 TabBar】一行代码实现 Lottie 动画TabBar,支持中间带+号的TabBar样式,自带红点角标,支持动态刷新。【iOS13 & Dark Mode & iPhone XS MAX supported】
MIT License
6.92k stars 1.46k forks source link

ios 13 tabbar分割线隐藏修复 #436

Open xiaohange opened 5 years ago

xiaohange commented 5 years ago



Base Info for this issue

  1. Version:Latest Version as here
  2. Language of App :Objective-C/Swift
  3. iOS System Version:iOS12
  4. Prototype(是否是真机):YES
  5. Issue Type:Crash、Bug、Enhancement(希望能支持一个新需求)、Q-A

1. How to reproduce the problem.

2. Please help me in this way.

3. Here is a Demo.

4. Here is my Debug log


chen570075003 commented 5 years ago

在 TabBarController 类中添加以下代码

if (@available(iOS 13.0, *)) {
        UITabBarAppearance *standardAppearance = [[UITabBarAppearance alloc] init];
        standardAppearance.backgroundColor = [UIColor whiteColor];
        standardAppearance.shadowImage = [UIImage imageNamed:@"TabBar_Shadow"];
        self.tabBar.standardAppearance = standardAppearance;
    }
xiaohange commented 5 years ago

@chen570075003 谢谢

GKWenBo commented 5 years ago

这样写在iOS 13也可达到隐藏的效果:

//隐藏分割线
        if (@available(iOS 13.0, *)) {
            UITabBarAppearance *tabBarAppearance = [[UITabBarAppearance alloc] init];
            [tabBarAppearance configureWithDefaultBackground];
            tabBarAppearance.shadowColor = [UIColor clearColor];
            tabBarAppearance.backgroundColor = [UIColor whiteColor];
            UITabBar.appearance.standardAppearance = tabBarAppearance;
            self.tabBar.standardAppearance = tabBarAppearance;
        } else {
            [[UITabBar appearance] setShadowImage:[[UIImage alloc]init]];
            [[UITabBar appearance] setBackgroundImage:[[UIImage alloc]init]];
            [UITabBar appearance].backgroundColor = [UIColor whiteColor];
        }
xiaohange commented 5 years ago

tabBarAppearance.shadowColor = [UIColor clearColor];

非常感谢回复~

Xue765 commented 4 years ago

iOS13 不是隐藏底部分割线,是淡化分割线。有好的方法吗?

Lee0820 commented 4 years ago

@wenmobo @chen570075003 你好,我这么设置了确实达到了设置分割线的效果,但是 CYLTabBarItemTitlePositionAdjustment设置的偏移量就失效了,是时机问题不对吗?

wdy1995 commented 4 years ago

@wenmobo @chen570075003 你好,我这么设置了确实达到了设置分割线的效果,但是 CYLTabBarItemTitlePositionAdjustment设置的偏移量就失效了,是时机问题不对吗?

请问这个问题解决了吗,新版本有修复吗

Lee0820 commented 4 years ago

@wdy1995 我今天刚注意到 13.4.1的手机上用老api,也可以,分割线可以设置成功,13.3的还是有问题