在iOS 13上,使用诸如“Show”之类的按钮插入 View Controller 会导致在显示的 View Controller (VC2)上不调用supportInterfaceOrientations。结果,即使supportedInterfaceOrientations仅返回.landscape, Controller 也会自动旋转为纵向模式。但是,如果我们通过任何Segue从该 Controller (VC2)插入另一个 View Controller (VC3),则VC3不会自动旋转。
我发现的唯一解决方法是使用模式呈现样式fullScreen将VC2呈现为模态视图 Controller 。我在iPad设备上不想要此功能,因此请寻找在iOS 13上以这种方式发生这种情况的原因并进行修复。
最佳答案
您必须在 View Controller 上将“表示样式”设置为“全屏”,然后将调用supportedInterface覆盖。
或查看此以获取更多信息
How to present a modal atop the current view in Swift