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?
UPD:
code in VC that I want to have white status bar (prefferdSTatusBarStyle
not called)
code in VC with hidden status bar
.plist settings
Result is black status bar, that hides in some VC
UPD2:
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.