我以编程方式创建了所有视图,IB 没有。我的视图包含导航控制器、表格视图、按钮、标签栏。现在我应该如何让我的应用程序支持 iOS 5 和 iOS 6 的所有方向。
问问题
129 次
3 回答
0
这在 iOS 6 中已更改:
- (NSInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}
于 2012-12-03T13:48:18.720 回答
0
把这个写在你所有的UIViewController
-s 中:
- (NSInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskAll;
}
- (BOOL)shouldAutorotate {
return YES;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return YES;
}
于 2012-12-03T12:59:38.007 回答
0
您是否尝试设置项目目标的摘要窗格中支持的设备方向,如附图所示?
于 2012-12-03T13:01:58.733 回答