【发布时间】:2016-10-26 14:00:57
【问题描述】:
我有一个应用程序已从项目设置中锁定为纵向模式。当我在 iPhone 设备上并旋转标签和视图时,在模拟器(和设备)上也应该是错误的等。但是在 iPad 上,当我更改为横向视图时,视图会尝试重新排列。为什么会这样?谢谢。
【问题讨论】:
-
从这里检查接受的答案:stackoverflow.com/questions/29664441/…
标签: ios swift orientation
我有一个应用程序已从项目设置中锁定为纵向模式。当我在 iPhone 设备上并旋转标签和视图时,在模拟器(和设备)上也应该是错误的等。但是在 iPad 上,当我更改为横向视图时,视图会尝试重新排列。为什么会这样?谢谢。
【问题讨论】:
标签: ios swift orientation
正如马修所说,尝试这样的事情
按照@ScarletMerlin 的建议,在我看来,更改 info.plist 中的键是我必须满足的要求的最佳解决方案(每种设备的固定方向类型)。
这是我使用的设置的打印屏幕。也许它可以帮助其他有类似疑问的开发人员。
相关源码如下:
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
【讨论】: