2

我为 iPad 构建的应用程序有一点问题。我有几个固定在纵向模式下的视图,还有一些可以在纵向或横向模式下工作的视图。一切都很好 - 我有 shouldAutorotateToInterfaceOrientation: 给我正确的结果,并且视图最终会以正确的方向结束。

我说“最终”是因为当我将设备置于横向模式时,我的一些视图会出现这种奇怪的行为,当我切换到它们时,它们会以纵向模式出现并且可见旋转到横向模式。它非常快,但它是可见且令人恼火的。奇怪的是,它只发生在三个视图中的两个中——第三个视图没有这种行为。这是一致的——每次我去“问题”视图时,他们都会给我同样的恼人行为。

有没有其他人看到这个?我做错了什么导致这种情况?

4

1 回答 1

0

您必须在 Info.plist 中设置所有支持的方向

<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>
于 2010-08-10T20:11:33.263 回答