我遇到一个奇怪的问题,隐藏然后显示UINavigationBar导致它将颜色变为永久黑色,因此我无法设置其颜色。
NaviationBar最初设置为灰色色调的简单示例:
// NavigationBar Colour is initially set - this works
[[UINavigationBar appearance] setBarTintColor:[UIColor red]];
// Then it is hidden and then shown
[self.navigationController setNavigationBarHidden:YES animated:NO];
....
[self.navigationController setNavigationBarHidden:NO animated:NO];
状态栏色调颜色现在为黑色,无法通过设置外观或直接设置颜色来更改。
任何人都可以解释这个并知道修复此问题的解决方案吗?
答案 0 :(得分:-3)
When you set the color of navigation bar then put your appropriate code into **view Will appea**r and **View Will Disappear method**. When you do transition between view then it's set the Main view (Window) Navigation bar color. We discuss topic in this link.
http://stackoverflow.com/questions/23539913/splitviewcontroller-detailviewcomtrollers-navigationbar-color-changes-to-pink-g/23540110?noredirect=1#comment36113939_23540110