iosobjective-cxcodeios10statusbar

Xcode Hide white status bar ios 10


I want white status bar in my app. For this I set View controller-based status bar appearance to NO and Status bar style to UIStatusBarStyleLightContent. But now I need to hide status bar in some view controllers.

To hide it I have to set View controller-based status bar appearance to YES and add - (BOOL)prefersStatusBarHidden {return YES;}. But status bar is black now. It's black when View controller-based status bar appearance is YES and white if NO.

So the question is: how to set white status bar and hide it?

Update:

Code in VC that I want to have white status bar (preferredStatusBarStyle not called)

enter image description here

Code in VC with hidden status bar

enter image description here

.plist settings

enter image description here

Result is black status bar, that hides in some VC

Update #2:

I know it's bad to use deprecated methods but with [[UIApplication sharedApplication] setStatusBarHidden:YES]; everything works as I want. If anyone have better solution please let me know.


Solution

  • you can set using xcode status bar style is "light"

    enter image description here