即使设备在目标c中水平旋转,如何始终以纵向模式加载UIViewController?

时间:2015-08-26 07:34:16

标签: ios objective-c iphone uiviewcontroller

我有UIViewController处于纵向模式,当我转到另一个UIViewController并水平旋转设备然后回到之前的UIViewController它的视图都搞砸了。我的应用程序支持设备的每个方向,我实现了方法:

- (BOOL)shouldAutorotate {
    return NO;
}

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskPortrait;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
    return UIInterfaceOrientationPortrait;
}

但我无法解决这个问题。无论设备方向和以前加载的UIViewContoller的方向如何,如何始终纵向加载UIViewContoller?感谢您的回答和帮助。

0 个答案:

没有答案