隐藏tabBar分割线

1.在AppDelegate中设置

1
2
3
4
[UITabBar appearance].translucent = NO;
[[UITabBar appearance] setBarTintColor:[UIColor clearColor]];
[[UITabBar appearance] setBackgroundImage:[self imageWithColor:[UIColor clearColor]]];
[[UITabBar appearance] setShadowImage:[[UIImage alloc] init]];

2.在UITabBarController中添加

1
2
3
4
5
6
7
8
9
if (@available(iOS 13.0, *))
{
UITabBarAppearance *appearance = [UITabBarAppearance new];
appearance.backgroundColor = [UIColor clearColor];
appearance.backgroundImage= [UIImage new];
appearance.shadowColor = [UIColor clearColor];
appearance.shadowImage= [UIImage new];
self.tabBar.standardAppearance = appearance;
}

3.搞定