カスタムサイドメニューコントローラに表示したいUINavigationControllerの配列があります。それはすべて動作しますが、私はデバイスの向きをランドスケープに変更し、UINavigationControllerを以前にポートレートで表示されていた配列から表示すると、オフスクリーンで表示されます... UINavigationControllersの向きを修正する方法はありますか?ここでUINavigationControllerの向きを修正する
はイムがそれらを提示する方法である:
func presentNavigationViewController(_ navigationViewController: UINavigationController) {
//// removing old centerNavigationController
self.centerNavigationController?.view.removeFromSuperview()
self.centerNavigationController?.view.removeGestureRecognizer(panGestureRecognizer)
self.centerNavigationController?.removeFromParentViewController()
self.centerNavigationController = navigationViewController
//// corecting view position based on status of side menu
switch self.currentState {
case .Expanded:
self.centerNavigationController.view.frame.origin.x = centerNavigationController.view.frame.width - ContainerViewController.centerPanelExpandedOffset
case .Collapsed:
self.centerNavigationController.view.frame.origin.x = 0
}
//// and presenting
self.view.addSubview(centerNavigationController.view)
self.addChildViewController(centerNavigationController)
self.centerNavigationController.didMove(toParentViewController: self)
self.centerNavigationController.view.addGestureRecognizer(panGestureRecognizer)
}
どのようにあなたはアレイからコントローラを提示していますか? –
質問に実装の詳細を追加しました。 – Radek