我想仅支持UIInterfaceOrientationLandscapeRight和UIInterfaceOrientationLandscapeLeft

时间:2010-04-15 17:32:55

标签: iphone objective-c cocoa-touch ipad interface-builder

如何确保不支持UIInterfaceOrientationPortraitRight和UIInterfaceOrientationPortraitLeft。

基本上我希望我的应用程序仅用于UIInterfaceOrientationLandscapeRight和UIInterfaceOrientationLandscapeLeft

我编辑了Info.plist文件

<string>MainWindow</string>
 <key>UISupportedInterfaceOrientations</key>
 <array>          
      <string>UIInterfaceOrientationLandscapeLeft</string>
      <string>UIInterfaceOrientationLandscapeRight</string>
 </array>

1 个答案:

答案 0 :(得分:4)

确保在UIViewController中的每个UITabBarController / shouldAutoRotateToInterfaceOrientation等中,返回显示return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight));。