由于ShouldAutorotateToInterfaceOrientation在iOS 6中已弃用并且我使用它来强制特定视图仅限于纵向,在iOS 6中执行此操作的正确方法是什么?这仅适用于我的应用的一个区域,所有其他视图都可以旋转.
我有一个项目使用UINavigationController和segues工作正常,所有这些都正确旋转,事情是......我只是想禁用autorotation特定的UIViewController.我试过这个:
- (BOOL)shouldAutorotateToInterfaceOrientation:
(UIInterfaceOrientation)interfaceOrientation {
return NO;
}
// New Autorotation support for iOS 6.
- (BOOL)shouldAutorotate NS_AVAILABLE_IOS(6_0){
return NO;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
Run Code Online (Sandbox Code Playgroud)
但它不起作用,我UIViewController会自动旋转,欢迎任何帮助:)
模态UIViewController的父级自动旋转,但是当模态VC启动时,我只希望它以纵向显示而不能旋转.我试过简单地从shouldAutorotate模态VC中返回NO ,但没有快乐.支持iOS 5+.
任何帮助非常感谢.