在iOS 13上未调用supportedInterfaceOrientations

Dee*_*rma 5 uiviewcontroller uikit ios ios13

在iOS 13上,使用诸如“ Show”之类的按钮推动视图控制器会导致在显示的视图控制器(VC2)上不调用supportInterfaceOrientations。结果,即使supportedInterfaceOrientations仅返回.landscape,控制器也会自动旋转为纵向模式。但是,如果我们通过任何Segue从该控制器(VC2)推入另一个视图控制器(VC3),则VC3不会自动旋转。

The only workaround I have found is presenting VC2 as modal view controller using modal presentation style fullScreen. This is not I want on iPad devices, so looking for the reason why it is happening this way on iOS 13 and a fix.

Joh*_*ion 8

您必须将视图控制器上的“演示样式”设置为全屏,然后将调用 supportedInterface 覆盖。

故事板

或查看此了解更多信息

如何在 Swift 中的当前视图之上呈现模式