2016-02-03 17 views
0

我在我的MainController中有一个视图(contentView),女巫内容另一个UINavigationViewController(mainNavigationController)的视图。完美适合的屏幕(见图1)。iOS 8 UINavigationB重叠StatusBar

然后我写的函数来改变视图内容查看的视图到另一个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的导航栏变小(参照图像2):( 我想是因为状态栏的

。使用UIBarPositioningDelegate解决方案无效:(

感谢您的帮助!

image 1 image 2

回答

0

解决!

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

enter image description here