开发者

I want to support UIInterfaceOrientationLandscapeRight and UIInterfaceOrientationLandscapeLeft only

开发者 https://www.devze.com 2022-12-26 19:12 出处:网络
how do I make sure that UIInterfaceOrientationPortraitRight and UIInterfaceOrientationPortraitLeft are not supported.

how do I make sure that UIInterfaceOrientationPortraitRight and UIInterfaceOrientationPortraitLeft are not supported.

Basically I want my 开发者_Python百科application to be used ONLY in UIInterfaceOrientationLandscapeRight and UIInterfaceOrientationLandscapeLeft

I edited the Info.plist file

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


Make sure that in every UIViewController/UITabBarController etc., in the shouldAutoRotateToInterfaceOrientation, the return says return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight));.

0

精彩评论

暂无评论...
验证码 换一张
取 消