Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Completely transparent UITabBar in iOS 8

I'm trying to make my tabBar transparent, I've searched but all I found was articles resulting in partly and not fully transparent tabBars and some were for IOS 5, etc.

I would like to accomplish this as seen in Sketch 3:

enter image description here

What's the easiest way to accomplish this?

I thought of doing this:

    // Make the tabBar transparent
self.tabBarController.tabBar.backgroundColor = [UIColor clearColor];
self.tabBarController.tabBar.translucent = YES;

but that result wasn't exactly perfect:

enter image description here

Really appreciate help!:)

Sincerely, Erik

Update

// Make the tabBar transparent
[[UITabBar appearance] setBarTintColor:[UIColor clearColor]];
self.tabBarController.tabBar.translucent = YES;
like image 336
Erik Avatar asked Oct 09 '14 13:10

Erik


2 Answers

Have you tried the barTintColor?

[[UITabBar appearance] setBarTintColor:[UIColor clearColor]];
[[UITabBar appearance] setBackgroundImage:[UIImage new]];

That should do the trick.

like image 88
Johannes Fahrenkrug Avatar answered Sep 22 '22 21:09

Johannes Fahrenkrug


Swift 3.0

... call this code in the AppDelegate's didFinishLaunchingWithOptions

let tabBar = UITabBar.appearance()
tabBar.barTintColor = UIColor.clear
tabBar.backgroundImage = UIImage()
tabBar.shadowImage = UIImage()

The result will be a transparent background for every UITabBar.

like image 45
user3378170 Avatar answered Sep 21 '22 21:09

user3378170