1

In my app, I have the status bar's style set to Black Opaque under Summary in the app's target. However, when I change my navigationController's background color with self.navigationController.view.backgroundColor = self.view.backgroundColor; the color suddenly changes to grey.

Before:

enter image description here

After:

enter image description here

Why is this? What can I do to prevent this from happening?

Despite it being set as black opaque in the app Summary, it says translucent when I NSLog it. Why?

Doug Smith
  • 29,668
  • 57
  • 204
  • 388

2 Answers2

3

You should disable status bar tinting. From iOS 6.0 release notes:

It is now possible to set status bar tint parameters in your app’s Info.plist file. You might do this to ensure that the status bar color matches your app’s navigation bar color during startup. To set the status bar tint, add the UIStatusBarTintParameters key to your Info.plist file. The value of this key is a dictionary with the appropriate values describing the navigation bar your app has at startup. Inside the dictionary should be the UINavigationBar key, which has a value that is also a dictionary. That dictionary contains the initial navigation bar’s style (with the Style key) and indicates whether it is translucent (with the Translucent key). You can also specify your navigation bar’s tint color (with the TintColor key) or the name of its custom background image (with the BackgroundImage key).

cahn
  • 1,350
  • 1
  • 12
  • 24
  • This is what I have it set as right now: http://i.imgur.com/RcC3gK6.png I then even deleted it and it still shows grey. – Doug Smith Jul 29 '13 at 15:37
  • Looks like status bar has changed to translucent at runtime. Check the value of `[UIApplication sharedApplication].statusBarStyle` just before changing navigation controller background color. – cahn Jul 30 '13 at 01:02
  • If I use `NSLog(@"%d", [UIApplication sharedApplication].statusBarStyle);` it gives me `1` both before and after it changes to grey. – Doug Smith Jul 30 '13 at 23:14
  • But if I check if it equals `UIStatusBarStyleTranslucent` it says yes. What? – Doug Smith Jul 30 '13 at 23:15
0

Groan. My AppDelegate was changing it to translucent.

Doug Smith
  • 29,668
  • 57
  • 204
  • 388