iOS 6:无法在单个视图中强制纵向模式和横向模式
问题描述:
我正在搜索整个网络的天数,但无法找到答案。iOS 6:无法在单个视图中强制纵向模式和横向模式
问题是:我不能强制我的应用程序只提供纵向模式下的所有UIViewControllers,除了一个UIViewController,它应该能够在4种模式中的任何一种模式下工作。
那是我的选择:
- 的iOS 6
- 的UINavigationController
- 的UITabBarController
- 故事板
- 所有模式的项目(也Info.plist中)
- (BOOL)shouldAutorotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
但它并不甚至似乎工作..
任何想法?
答
找到了答案:
子类的UINavigationController(https://stackoverflow.com/a/12999017/1011125)OR的UITabBarController如果使用的话。
就是这样:)。