【问题标题】:Launching landscape app according to iOS human interface guidelines根据 iOS 人机界面指南启动横向应用程序
【发布时间】:2015-06-11 08:35:37
【问题描述】:
根据iOS Human Interface Guidelines,当设备处于纵向模式时,横向应用程序应始终以右侧的主页按钮启动。
但是,我无法使启动屏幕的行为符合此预期。因此,当应用从启动屏幕转换到应用窗口时,我会尽最大努力实现垂直翻转。
我查看了一些应用程序,并不是每个人都遵守这一准则,但其他人这样做,所以这个问题肯定是可以解决的。因此,我正在寻找的行为是在启动期间“暂时禁用”横向向左方向,当且仅当我们处于纵向模式时。
感谢任何帮助!
【问题讨论】:
标签:
ios
uiinterfaceorientation
device-orientation
【解决方案1】:
我刚刚发现了解决方案:
当一个横向应用程序以纵向模式启动时,将根据应用程序 plist 文件中 UISupportedInterfaceOrientations 节点下的条目顺序选择方向(即是左还是右)。
所以解决方案是从 xcode 生成的变更项订单
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
到
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
</array>