iPad アプリにモーダル ビューを追加しようとしています。すべてのビューは横向きモードになっているはずです。スタイルには、フォームまたはページ シートを選択しました。
これが問題です。次のコードを使用してモーダル ビューをビューに追加すると:
TempController *tmpViewController = [[TempController alloc] initWithNibName:@"TempView" bundle:nil];
tmpViewController.modalPresentationStyle = UIModalPresentationPageSheet;
[self presentModalViewController:tmpViewController animated:YES];
私のモーダル ビューは横向きモードで表示されますが、その下のビューは縦向きで表示されます。モーダルが閉じられた後、ビューはまだポートレイトのままです。ビューにモーダルをアタッチしないと、ビューは横向きモードで正常に表示されます。
statusBarOrientation と shouldAutootateToInterfaceOrientation で遊んでみましたが、まだ運がありません。Mountain Lion で xcode 4.4.1 を実行しています
更新: これは私の shouldAutorotateToInterfaceOrientation です:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
return YES;
}
return NO;
}