iOS 6:无法在一个视图中强制执行纵向模式和横向模式

时间:2013-05-08 17:39:26

标签: ios6 orientation landscape-portrait auto-rotation

我在整个网上搜索了几天,但找不到答案。

问题是:我无法强制我的应用程序以纵向模式呈现所有UIViewControllers,除了一个UIViewController,它应该能够在4种模式中的每一种模式下工作。

这些是我的选择:

  • iOS 6
  • 的UINavigationController
  • 的UITabBarController
  • 故事板
  • 项目中也启用了所有模式(也在Info.plist中)

我已经尝试了

- (BOOL)shouldAutorotate {
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskPortrait;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

但它似乎无法正常工作..

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

找到答案:

就是这样:)。