如何确保不支持 UIInterfaceOrientationPortraitRight 和 UIInterfaceOrientationPortraitLeft。
基本上我希望我的应用程序仅在 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))
;.
关于iphone - 我只想支持 UIInterfaceOrientationLandscapeRight 和 UIInterfaceOrientationLandscapeLeft,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2647607/