0

I want to go from a black statusbar to a white statusbar.

This is my vc structure: A -> nav controller -> B

Somehow I can't seem to set it to white, whatever I try. I tried the simplest solution of setting the navigationController's style to black, but that won't work either!! I'm stuck on this for hours, and I've even tried to a custom extension on UINavigationController but somehow the statusbar seems really unresponsive. For reference, this is my nav/statusbar like:

enter image description here

This is my setup in VC B:

self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent; 
[self preferredStatusBarStyle];

Am I missing something big? How can the statusbar be black when the navbar is black too?

bdv
  • 1,154
  • 2
  • 19
  • 42

1 Answers1

-1

Open the "info.plist" file. Add a new item with "Status bar style" as the key and "Opaque black style" as the value.

This should solve your problem

2nd Solution:

 [[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleBlackOpaque];

You can see different statusBarStyle in the above function. Call this in your viewController

Arun Gupta
  • 2,628
  • 1
  • 20
  • 37
  • I can't do that as I need a non-opaque one elsewhere in my project, not including this value in the plist means just that i should be able to set it per vc, as i've set that value to be vc independent. – bdv Dec 24 '14 at 22:50
  • I'm sorry but as I said in my question i've already tried a lot of those things. I'm looking for an answer that tells me how this is possible and how to fix it, and *why*. Not some random answer copied-pasted from another so question. – bdv Dec 26 '14 at 01:50