【发布时间】:2012-09-21 15:37:12
【问题描述】:
在 iOS6 中,shouldAutorotateToInterfaceOrientation 已弃用。我尝试使用supportedInterfaceOrientations 和shouldAutorotate 使应用程序正常工作以进行自动旋转,但失败了。
这个 ViewController 我不想旋转,但它不起作用。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
-(BOOL)shouldAutorotate
{
return NO;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
有什么想法吗? 提前感谢您的帮助!
【问题讨论】:
-
视图控制器是嵌入在导航控制器还是标签栏控制器中?
-
嵌入在导航控制器中。 @phix23
标签: ios uiviewcontroller ios6 autorotate