0

私のアプリケーションは横向きモードのみをサポートする必要があるため、info.plist キーを構成して正しい方法で取得します。
私のルートビューコントローラーは、メインウィンドウに追加して実装するカスタム UINavigationController です

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight));
}

問題はinterfaceOrientation、アプリケーションが UIInterfaceOrientationLandscapeLeft の向きで起動された場合でも、applicationDidFinishLaunching の後、常に UIInterfaceOrientationLandscapeRight になることです。
その結果、スプラッシュ画像は適切な向きになり、アプリケーションは上下逆になります。
デバイスをしばらく振ってから、コントローラーを正しい方向に再び回転させます。

バグですか?これを解決するにはどうすればよいですか?

4

1 に答える 1

0

これは私にとってとてもうまくいきます

  • (BOOL)shouldAutorotateToInterfaceOrientation(UIInterfaceOrientation)interfaceOrientation {

    if (UIInterfaceOrientationIsLandscape(interfaceOrientation)) {

    はいを返します。

    }そうしないと{

    いいえを返します。

    }

    }

幸運を

于 2011-12-01T09:12:57.943 に答える