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.
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.
You need to subclass the UITabBarController and in the viewdidload:
you should put this code:
CGRect rect = CGRectMake(0, 0, 1, 1);
UIGraphicsBeginImageContextWithOptions(rect.size, NO, 1.0);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [UIColor clearColor].CGColor);
CGContextFillRect(context, rect);
UIImage *transparentImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[self.tabBar setBackgroundImage:transparentImage];
[self.tabBar setShadowImage:transparentImage];
// self.tabBar.alpha = 0.0;
Have you tried the barTintColor
?
[[UITabBar appearance] setBarTintColor:[UIColor clearColor]];
[[UITabBar appearance] setBackgroundImage:[UIImage new]];
That should do the trick.