iOS 10: preferredStatusBarStyle property not honored

When presenting a modal view controller on iOS 10, the preferredStatusBarStyle property is not honored. Instead, the status bar style remains set to the presented view controller's preferredStatusBarStyle.


This used to work in iOS 9 but appears to be broken in iOS 10.

Answered by chepiok in 180445022

finaly it works with a self.modalPresentationCapturesStatusBarAppearance = YES;

I can't help, but note that this is the Cocoa forum, not Cocoa-Touch. You may get a better response over there!

same issue for me. still investigating.

The same is happening to me with prefersStatusBarHidden. Can't manage to have it honored when presentingoverCurrentContext on iOS 10.

Have you tried calling setNeedsStatusBarAppearanceUpdate()?

Accepted Answer

finaly it works with a self.modalPresentationCapturesStatusBarAppearance = YES;

Thanks chepiok! That was it!


So technically, this wasn't working in previous versions of iOS and now it's been "fixed" in iOS 10.


My modalPresentationStyle was set to OverCurrentContext, and per the documentation, setting it to anything other than FullScreen requires modalPresentationCapturesStatusBarAppearance to be set to true.


- number4

i did but didn't have any success. See correct answer below by chepiok.

Moved. Thanks!

chepiok's answer WORKS great to me, thank you.
iOS 10: preferredStatusBarStyle property not honored
 
 
Q