我有一个基于导航的应用程序,它有一个详细视图 (UIWebView),在 UIToolbar 的底部带有操作按钮。我想在按下“笔记”按钮时添加“笔记”。当 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];
}
有任何想法吗?我尝试了各种不同的方法都无济于事。我只是得到一个没有导航栏的白屏(尽管顶部有一个状态栏)。