Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove top line from TabBar

Tags:

On iOS 10 this code doesn't work in order to remove the tabBar shadow line:

[[UITabBar appearance] setShadowImage:[[UIImage alloc] init]]; 

Somebody knows, what must I do to remove it?

On iOS 9.3 with this two lines the line is removed, but iOS 10 ignores setShadowImage command.

like image 401
jcamacho Avatar asked Oct 04 '16 11:10

jcamacho


1 Answers

removes the topline for @iOS 13.0

let appearance = tabBar.standardAppearance appearance.shadowImage = nil appearance.shadowColor = nil tabBar.standardAppearance = appearance; 

removes the topline for iOS 12.0 and earlier

tabBar.shadowImage = UIImage() tabBar.backgroundImage = UIImage() 
like image 94
sahiljain Avatar answered Oct 08 '22 19:10

sahiljain