UIStatusBarStyle changes after displaying a UIWindow over UIStatusBar UIStatusBarStyle changes after displaying a UIWindow over UIStatusBar ios ios

UIStatusBarStyle changes after displaying a UIWindow over UIStatusBar


I came across this topic while struggling with the same problem. What you have to do is create a new view controller and set it as the root view controller of your UIWindow (that is the UIWindow that you are displaying over your other view). Then, in this new view controller implement the preferredStatusBarStyle method like this:

- (UIStatusBarStyle) preferredStatusBarStyle {    return UIStatusBarStyleLightContent;}

Alternatively, you can set the "View controller-based status bar appearance" property in Info.plist to NO and implement the [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent] method as Azabella suggested. However, this will set the Status Bar of all your views to white. If that's no problem, then there's no need to make a separate view controller just to set the preferredStatusBarStyle method.


Did you set the "View controller-based status bar appearance" property in yourAppName-Info.plist to NO ?


This was a fairly trivial problem that I found to be resolved setting modalPresentationCapturesStatusBarAppearance to true.