【问题标题】:iPhone and iPad Portrait mode app different reactioniPhone和iPad人像模式app不同反应
【发布时间】:2016-10-26 14:00:57
【问题描述】:

我有一个应用程序已从项目设置中锁定为纵向模式。当我在 iPhone 设备上并旋转标签和视图时,在模拟器(和设备)上也应该是错误的等。但是在 iPad 上,当我更改为横向视图时,视图会尝试重新排列。为什么会这样?谢谢。

【问题讨论】:

标签: ios swift orientation


【解决方案1】:

正如马修所说,尝试这样的事情

按照@ScarletMerlin 的建议,在我看来,更改 info.plist 中的键是我必须满足的要求的最佳解决方案(每种设备的固定方向类型)。

这是我使用的设置的打印屏幕。也许它可以帮助其他有类似疑问的开发人员。

相关源码如下:

<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-03-07
    • 2014-05-03
    • 2017-09-14
    • 1970-01-01
    • 2014-07-23
    • 2011-08-25
    • 1970-01-01
    相关资源
    最近更新 更多