问题:
如果我在 UIInterfaceOrientationLandscapeRight 方向时将应用程序发送到后台,当我从多任务栏恢复应用程序时,方向是 UIInterfaceOrientationLandscapeLeft,这是默认的,用于显示的快照和 View 。 View 立即通过旋转回被挂起之前的最后一个已知方向 UIInterfaceOrientationLandscapeRight 重新定位自身。
已知数量:
观察到的行为:
当从多任务栏恢复应用程序时,应用程序会收到 2 个方向通知,这些通知分别由覆盖的 shouldAutoRotateToInterfaceOrientation 评估。首先是 UIInterfaceOrientationLandscapeLeft,然后是 UIInterfaceOrientationLandscapeRight。
预期成绩:
从多任务栏恢复应用程序时,方向与暂停时相同。因此,如果我们处于 UIInterfaceOrientationLandscapeRight 模式,那么我希望以相同的方向恢复。
最佳答案
我知道这是一篇旧帖子,但答案是您没有定义 key UISupportedInterfaceOrientations
在 Info.plist 文件中,值为 UIInterfaceOrientationLandscapeLeft
和 UIInterfaceOrientationLandscapeRight
.
关于iphone - iOS:从多任务栏恢复应用程序时如何保持方向?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4807707/