Open xiaohange opened 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;
}
@chen570075003 谢谢
这样写在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];
}
tabBarAppearance.shadowColor = [UIColor clearColor];
非常感谢回复~
iOS13 不是隐藏底部分割线,是淡化分割线。有好的方法吗?
@wenmobo @chen570075003 你好,我这么设置了确实达到了设置分割线的效果,但是 CYLTabBarItemTitlePositionAdjustment设置的偏移量就失效了,是时机问题不对吗?
@wenmobo @chen570075003 你好,我这么设置了确实达到了设置分割线的效果,但是 CYLTabBarItemTitlePositionAdjustment设置的偏移量就失效了,是时机问题不对吗?
请问这个问题解决了吗,新版本有修复吗
@wdy1995 我今天刚注意到 13.4.1的手机上用老api,也可以,分割线可以设置成功,13.3的还是有问题
Base Info for this issue
1. How to reproduce the problem.
2. Please help me in this way.
3. Here is a Demo.
4. Here is my Debug log