1

I'm building an iPad app using storyboards. In Interface Builder (XCode 4.5), the nav bar is the default (light grey) color...

enter image description here

However, when I run the app, it changes color to a dark grey...

enter image description here

Has anyone else had this problem? No matter what color I set it to in Interface Builder, it always ends up dark grey when I run it.

Thanks so much in advance for your wisdom!

4

2 回答 2

2

在 iOS 6 中,状态栏的颜色与导航栏的颜色相同。您可以根据此问题的答案对其进行自定义: How to change Statusbar on Modal Views iOS 6

于 2012-10-10T06:13:53.653 回答
1

您可以使用以下代码行为导航栏着色,只需使用它,导航栏始终为浅灰色:

[[navController navigationBar] setTintColor:[UIColor lightGrayColor]];

当您在界面生成器中设置导航栏颜色时,这只影响您在 IB 本身中获得的视图,它只是一个设计帮助。您必须在代码中设置的真实颜色。

于 2012-10-10T06:16:41.990 回答