我想支持UIInterfaceOrientationLandscapeRight和UIInterfaceOrientationLandscapeLeft只有
问题描述:
我如何确保不支持UIInterfaceOrientationPortraitRight和UIInterfaceOrientationPortraitLeft。我想支持UIInterfaceOrientationLandscapeRight和UIInterfaceOrientationLandscapeLeft只有
基本上我想只用于UIInterfaceOrientationLandscapeRight和UIInterfaceOrientationLandscapeLeft
我的应用程序编辑的Info.plist文件
<string>MainWindow</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
答
确保在每一个UIViewController
/UITabBarController
等,在shouldAutoRotateToInterfaceOrientation
,回报说return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight))
;。