UIToolbarの下部にアクションボタンがある詳細ビュー(UIWebView)を持つナビゲーションベースのアプリがあります。「メモ」ボタンを押したときに「メモ」を追加したい。Webビューがポートレートモードの場合、すべてが正常に機能します。ノートボタンを押すと、モーダルビューが正常に開き、うまく機能します。
この問題は、Webビューが横向きモードの場合に発生します。メモボタンを押すと、モーダルビューを開くためのすべてのコードが呼び出されますが、取得するのは白い画面だけです。コメント:モーダルビューを縦向きで開いてからデバイスを回転させると、横向きモードに正常に回転します。ランドスケープモードでは正しく 開きません。
同じ動作のメールコンポーザーを表示する別のボタンがあります。これが私のUIWebViewControllerのコードです:
- (IBAction)addNotes:(id)sender
{
NotesViewController *notesViewController;
// create the view controller and set it as the root view of a new navigation
// controller
notesViewController = [[NotesViewController alloc] initWithPrimaryKey:self.record.primaryKey];
UINavigationController *newNavigationController =
[[UINavigationController alloc] initWithRootViewController:notesViewController];
// present the navigation controller modally
[self presentModalViewController:newNavigationController animated:YES];
[notesViewController release];
[self.view setNeedsDisplay]; // not sure if I need this! I was trying different things...
[self.devotionText setNeedsDisplay]; // ditto...
[newNavigationController release];
}
何か案は?私はいろいろなことを試しましたが無駄になりました。ナビゲーションバーのない白い画面が表示されます(上部にステータスバーがありますが)。