【问题标题】:Device Orientation upside down not working设备方向倒置不起作用
【发布时间】:2016-04-07 19:33:11
【问题描述】:

我有一个用 swift 编码的单视图应用程序。

我已将设备方向设置为纵向和倒置。不支持横向。

当同时在 sim 和 5s 上运行时,将设备倒置没有效果,UI 仍保留在库存 portrait 位置。

我已经检查了情节提要orientation,这被设置为推断。

我显然遗漏了一些东西,因此我们将不胜感激。

我的目标是IOS 9.0, building using XCode 7.3 (7D175)。

【问题讨论】:

  • 尝试在您的 appdelegate 中添加 supportedInterfaceOrientationsForWindow 并返回所需的方向

标签: ios iphone swift ios9 uiinterfaceorientation


【解决方案1】:

试着把它放在你的 plist 文件中

<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>

并且还在部署信息上的常规选项卡上验证您的目标是否有这个:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-24
    • 1970-01-01
    • 2012-05-27
    相关资源
    最近更新 更多