我有一个使用 UINavigationController
和 segues
的项目,它们都能正确地旋转,但问题是... 我只想在特定的 UIViewController
上禁用 autorotation
。
我尝试过以下代码:
- (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;
}
但是它不起作用,我的UIViewController
会自动旋转,欢迎提供任何帮助 :)