7

Consider the following setup:

  • You have a simple application with a single UINavigationController subclass and a single UIViewController subclass in it.
  • The UINavigationController overrides preferredStatusBarStyle() method and returns UIStatusBarStyle.LightContent
  • The UIViewController overrides prefersStatusBarHidden() method and returns true

In iOS 8.0 - 8.2 when another UINavigationController (with another UIViewController that does not override anything) is presented with the modalPresentationStyle set to UIModalPresentationStyle.OverCurrentContext, the newly presented controller inherits the status bar appearance and visibility.

But in iOS 8.3 in the exact same situation - the newly presented controller does not inherits the status bar appearance and visibility

Another example would be to present an instance of UIImagePickerController - the exact same thing happens regarding the status bar appearance.

The questions are:

  • Why in iOS 8.3 the newly presented controller does not inherit the status bar appearance?
  • What has been changed (I was unable to find any meaningful reference in the iOS 8.2 to 8.3 API diff regarding this)?
  • Is there any elegant solution to this, instead of overriding everywhere the appearance and visibility methods?
KoCMoHaBTa
  • 1,519
  • 15
  • 16

1 Answers1

8

Try that:

(viewControllerToBePresented).modalPresentationCapturesStatusBarAppearance = true
Fabio
  • 1,757
  • 19
  • 33