2009年

[iPhone] 横表示のアプリで警告画面が縦向きに表示されてしまう このエントリーを含むはてなブックマーク

iPhone/iPod touch Add comments

横表示がデフォルトのアプリを作成しているのですが、警告画面が縦向きに表示されてしまいます。

警告画面が縦に表示される

警告画面が縦に表示される



info.plist で以下のように指定して横表示にしています。
UIInterfaceOrientation = UIInterfaceOrientationLandscapeRight
UIStatusBarHidden = YES

以下のサイトによると
iPhone – Develop ? Blog Archive ? UIAlertViewの向き

どうやら、UIAlertViewの向きはStatusBarの向きに依存しているようで、StatusBarもLandscapeにしてやらないといけないらしい。

ということで、ステータスバーも横向きにしてやらないといけないようです。非表示にしていたので気がつかなかった。
AppDelegate に以下のように指定して解決しました。

- (void)applicationDidFinishLaunching:(UIApplication *)application {
    [UIApplication sharedApplication].statusBarOrientation =
        UIInterfaceOrientationLandscapeRight;
}

関連する投稿

Leave a Reply

Additional comments powered by BackType

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS ログイン