在我的应用程序中,我有一个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