Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIRectEdgeNone makes NavigationBar and Tabbar darker

I have an iOS 7 app that has a NavigationController inside TabbarController. I then customize the bars background color

[[UINavigationBar appearance] setBarTintColor:[UIColor blueColor]];
[[UITabBar appearance] setBarTintColor:[UIColor blueColor]];

It runs fine. But if there's a ViewController that wants not to be covered by the bars, like this

self.edgesForExtendedLayout = UIRectEdgeTop;

Which means this ViewController does not want to be covered by the Tabbar. But it makes the Tabbar darker than normal

I think this is because I use custom color for the bars. How to fix ?

like image 493
onmyway133 Avatar asked Apr 06 '14 13:04

onmyway133


2 Answers

It probably means that the there's nothing to show below the translucent tab bar. Set the tab bar translucent property to NO

like image 175
rounak Avatar answered Sep 20 '22 18:09

rounak


@rounak is right, maybe setting the tab or nav bar's translucency to NO tells iOS not to try to put another tab or nav bar under the current one, which makes it darker.

In the viewDidLoad, add this:

self.navigationController.navigationBar.translucent = NO; // if you have a nav

self.tabBarController.tabBar.translucent = NO; // if you have a tab
like image 25
qq456cvb Avatar answered Sep 22 '22 18:09

qq456cvb