IOS shouldAutorotateToInterfaceOrientation在UIInterfaceOrientationLandscapeLeft的启动时没有正确自动旋转

时间:2011-10-18 08:02:47

标签: ios orientation launch autorotate

我设置了我的应用程序,使其在UIInterfaceOrientationLandscapeRight和UIInterfaceOrientationLandscapeLeft中运行。我在plist文件中设置了这些值,在我的shouldAutorotateToInterfaceOrientation中,它只会为这些方向返回YES。

这在大多数情况下都非常有效,除了在iPad上,如果我在发布期间将它放在LandscapeLeft中,我的应用程序将以纵向模式结束,除非我将iPad转换为LandscapeRight以调用方向更改。

查看日志,很明显在调用applicationDidBecomeActive之前会发生“willAnimateRotationToInterfaceOrientation”。我更改了我的代码,以便在调用applicationDidBecomeActive之前,shouldAutorotateToInterfaceOrientation为任何方向返回YES,并且仅在调用applicationDidBecomeActive之后为我的横向方向返回YES。现在我的应用程序也可以在LandscapeLeft中正确启动。然而,我不应该这样修理它并且我不知道iPad为什么会这样做。如果有人能向我解释这一点奇怪,我将不胜感激。

0 个答案:

没有答案