【发布时间】:2022-01-06 15:18:26
【问题描述】:
我有一个支持纵向和横向的应用程序。
所以在 Info.plist / Project Settings 我指定了两个方向。
在我的 UIViewController 中,我覆盖 supportedInterfaceOrientations 以返回 .landscape。
但是当我启动我的应用程序时,它首先以纵向模式显示(布局被破坏),然后令人不快的动画将其旋转为横向(参见视频)。
我还尝试用相同的结果覆盖 application(_, supportedInterfaceOrientationsFor window)。
示例项目demonstrating 问题:
https://s3.amazonaws.com/glazba/OrientationTest.zip
【问题讨论】:
标签: ios uiviewcontroller orientation uiwindow uiapplicationdelegate