【发布时间】:2020-02-11 09:03:58
【问题描述】:
我遇到的问题有点奇怪,我似乎找不到任何好的解决方案。所以我有两个 UIViewControllers,一个可以取所有方向,另一个只能横向查看
internal override func shouldAutorotate() -> Bool {
return true
}
internal override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
return UIInterfaceOrientationMask.Lanscape
}
如果我在 ViewController1 上处于纵向模式,并且按下 VC2,它会旋转得很好,但是当我离开 VC2 时,即使设备本身处于纵向模式,VC1 也会卡在横向模式。我该如何解决?我尝试在 VC1 的 ViewDidAppear 方法中调用 AttemptToRotateToDeviceOrientation 方法,但它没有做任何事情
【问题讨论】:
-
@mamun999 你可能误解了我的意思。我不是在问如何强制定向,我的解决方案已经在工作。我在问如何解决它的副作用
标签: ios swift uiinterfaceorientation interface-orientation