UITabBarController with UINavigationController in UISplitViewController breaks status bar

When adding a UINavigationController to a UITabBarController in a UISplitViewController, on an iPad running iOS 11, the status bar does now show the navigation bar.

Sample Code:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

    self.window = UIWindow.init(frame: UIScreen.main.bounds)

    let t1 = Test2ViewController.init(nibName: "Test2ViewController", bundle: nil)
    t1.view.backgroundColor = UIColor.green

    let t1nvc = UINavigationController.init(rootViewController: t1)

    let tbc = UITabBarController.init()
    tbc.viewControllers = [t1nvc]

    let t2 = Test2ViewController.init(nibName: "Test2ViewController", bundle: nil)
    t2.view.backgroundColor = UIColor.red

    let splitView = UISplitViewController()
    splitView.viewControllers = [tbc, t2]
    self.window!.rootViewController = splitView;
    self.window!.makeKeyAndVisible()

    return true
}

Phone View [iOS 11]:

*This looks correct

UITabBarController with UINavigationController in UISplitViewController breaks status bar

iPad View [iOS 11]:

*Notice the status bar

UITabBarController with UINavigationController in UISplitViewController breaks status bar

iPad View [iOS 10.3]:

*The status bar looks correct

UITabBarController with UINavigationController in UISplitViewController breaks status bar

0 Comment

NO COMMENTS

LEAVE A REPLY

Captcha image