理由はわかりませんが、iPhone を回転させても PhoneGap アプリが画面を回転しません。最も単純なコードでは機能しないため、コードを投稿しても意味がありません<div>Hello World!</div
。
向きの設定もチェックしています:
次に例を示します (実際のデバイスでも同じことが起こります)。
私と同じ問題。デリゲートに iOS6 の次の行を追加して解決しました。
- (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
{
NSUInteger supportedInterfaceOrientations = (1 << UIInterfaceOrientationPortrait) | (1 << UIInterfaceOrientationLandscapeLeft) | (1 << UIInterfaceOrientationLandscapeRight) | (1 << UIInterfaceOrientationPortraitUpsideDown);
return supportedInterfaceOrientations;
}
また、メイン コントローラーに以下を追加します。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return true;
}