UIRectEdgeNone使导航栏和Tabbar更暗

时间:2014-04-06 13:15:24

标签: ios7 tabbar navigationbar edge

我有一个iOS 7应用程序,在TabbarController中有一个NavigationController。 然后我自定义条形背景颜色

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

运行正常。但是如果有ViewController想要不被条形图覆盖,就像这样

self.edgesForExtendedLayout = UIRectEdgeTop;

这意味着此ViewController不希望被Tabbar覆盖。但它使Tabbar 更暗比正常

我认为这是因为我为酒吧使用自定义颜色。怎么解决?

2 个答案:

答案 0 :(得分:7)

这可能意味着半透明标签栏下方没有任何内容。将标签栏translucent属性设置为NO

答案 1 :(得分:7)

@rounak是对的,可能将标签或导航栏的半透明设置为NO告诉iOS不要尝试在当前的标签下放置另一个标签或导航栏,这会使其变暗。

在viewDidLoad中,添加:

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

self.tabBarController.tabBar.translucent = NO; // if you have a tab
相关问题