在我的應用程序中,我有一個UITabBarController
,其中包含3個UINavigationController
。我可以凍結任何UIViewController
的方向。爲此,我實施了UITabBarController
和UINavigationController
。但是當我從景觀中的另一個推動UIViewController
時會發生問題。新推送的UIViewController應該是縱向的,但它仍然在橫向。我知道問題可能不清楚,所以我附上scrrenshots。視圖控制器的固定方向
讓我們考慮它的VC-A。
從VC-A按編輯進入到這個VC-B。 VC-B是:
該VC-B應該總是肖像。 VC-A可以是橫向或縱向。當VC-A是在景觀和我按編輯的VC-B推和VC-B來在橫向模式下,雖然我實現了在VC-B這些方法:
-(BOOL)shouldAutorotate {
return UIInterfaceOrientationMaskPortrait;
}
-(NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationPortrait;
}
那不是問題所在。 – Rashad