iOS 8 UINavigationBar 与 StatusBar 重叠

iOS 8 UINavigationBar overlaps StatusBar

我的 MainController 中有一个视图 (contentView), contents 是另一个 UINavigationViewController (mainNavigationController) 的视图。完美适合屏幕(见图 1)。

然后我写了一个函数来将 contentView 的视图更改为另一个 UINavigationViewController 的视图:

func moveToNC(NCName:String) {

    let incomingViewController = UINavigationController(rootViewController: UIViewController())

    addChildViewController(incomingViewController)

    incomingViewController.view.frame = CGRectMake(0, 0, containerView.bounds.width, containerView.bounds.height)
    containerView.addSubview(incomingViewController.view)

    mainNavigationController.view.removeFromSuperview()
    mainNavigationController.removeFromParentViewController()

    incomingViewController.didMoveToParentViewController(self)

}

incomingNavigationController的NavigationBar变小了(见图2):( 我想是因为 StatusBar。

UIBarPositioningDelegate 的解决方案没有帮助:(

感谢帮助!

已解决!

问题是我在缩放时更改了视图。 (见图 3)。首先我应该删除比例然后更改视图。