IPad Multitasking Preferred Status Bar Style - Split Screen

I have two view controllers: the first has a UIStatusBarStyleDefault , the second has a UIStatusBarStyleLightContent .

VC1 represents VC2 as a sheet of modal shape. Therefore, when presented in the collection of regular features, VC2 appears as UIModalPresentationFormSheet , and VC1 sets the default status bar. But in the compact feature collection, VC2 is full-screen and sets the status line style to Light Content .

The problem is switching between normal and compact (full screen for sheet formation), the status bar is not updated.

Full split screen

Attempt - [self setNeedsStatusBarAppearanceUpdate]; after changing the collection of signs did not solve the problem.

Any help would be greatly appreciated!

+7
ios iphone split-screen-multitasking
source share
1 answer
 // This controls whether this view controller takes over control of the status bar appearance when presented non-full screen on another view controller. Defaults to NO. @available(iOS 7.0, *) public var modalPresentationCapturesStatusBarAppearance: Bool 

Using:

 navigationController.modalPresentationStyle = .FormSheet navigationController.modalPresentationCapturesStatusBarAppearance = true 

After that, the root view controller of this navigation controller can override the preferredStatusBarStyle ()

+1
source share

All Articles