iOS 7, navigation bar has no translucency… why does More tab look translucent?

空扰寡人 提交于 2020-01-07 02:01:21

问题


Our branding approach has us disabling the translucency property in iOS 7 in navigation and tab bars.

With a tab bar controller, the translucency is off for all the tabs, except when we click "more". If we choose one of the options on the "more" list, and then go back, then the translucency is gone (correctly). Changing tabs is correct.

When we go to "more" the first time, we want the translucency effect to not be applied.

Steps to Reproduce: 1. Tab bar controller with more than 5 tabs. 2. Set translucency to NO. 3. Change taps when running the app. Note that the "more" tab is incorrect until one of those items is chosen.

Expected Results: The top bar for all the tabs should be similar, that the translucency effect is not applied.

Actual Results: For the "more" tab, the translucency effect is applied although we turned it off.

How do we turn off translucency for the "more" tab?


回答1:


Are you talking about the navigation bar for the More view controller where the "More" title and Edit button exist? You can get a reference to that and set the translucent property to NO separately:

UINavigationController *navBarController = self.tabBarController.moreNavigationController;
navBarController.navigationBar.translucent = NO;



回答2:


I think you can use, change statusBarStyle with calling depend on your situation (UIStatusBarStyleDefault, UIStatusBarStyleLightContent etc) like this:

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

And after you should call this method for refresh.

[self setNeedsStatusBarAppearanceUpdate];


来源:https://stackoverflow.com/questions/19013967/ios-7-navigation-bar-has-no-translucency-why-does-more-tab-look-translucent

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!