2016-02-03 20 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