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解決方案無效:(
感謝您的幫助!