【问题标题】:UIImage View Not Rotating on Forced LandscapeUIImage 视图未在强制横向上旋转
【发布时间】:2018-03-09 23:41:48
【问题描述】:

我将 ViewController 的landscape 强制设置为 .landscapeRight。 ViewController 后跟一个没有设置类(默认)的 NavigationController。

let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.myOrientation = .landscapeRight

但是,UIImagenavigationBar(viewController 的顶部)不会旋转到我需要它的位置,直到我物理旋转屏幕。

我假设这与没有为导航控制器分配类有关,但我不确定。有人可以指出我正确的方向吗?

【问题讨论】:

  • 尝试转到应用目标上的常规选项卡(这是您设置应用显示名称的地方)。向下滚动到 Deployment Info 并尝试标记复选框 Landscape Right

标签: ios swift uinavigationcontroller landscape image-rotation


【解决方案1】:

这确实应该在您的视图控制器上完成。您是否通过将preferredInterfaceOrientationForPresentation 设置为.landscapeRight 以通常的方式尝试过。更多信息请查看this out

【讨论】: