任何正在尝试最新的iOS 6测试版(版本2或3)的人都有同样的自动旋转不工作的经历吗?
我使用的不是故事板,而是纯导航控件:
self.navController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
[self.window addSubview:navController.view];并具备:
- (BOOL)shouldAutorotateToInterfaceOrientation: ](UIInterfaceOrientation)interfaceOrientation
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
} else {
return YES;
}
}
- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskAllButUpsideDown;
}但是IOS根本没有支持,在3GS/4S和4.3,5.0.5.1模拟器上与所有以前的iOS都能很好地工作,但iOS 6似乎有问题
发布于 2012-07-18 23:04:24
在iOS 6中,自动旋转发生了变化。在iOS 6中,不推荐使用UIViewController的shouldAutorotateToInterfaceOrientation:方法。取而代之的是,您应该使用supportedInterfaceOrientations和shouldAutorotate方法。
Read more here。
https://stackoverflow.com/questions/11544382
复制相似问题