0

当我以模态方式呈现视图控制器时:

// 模态显示导航控制器。

[self presentModalViewController:theNavController Animation:YES];

导航栏被遮住了弹出的视图!我怎样才能让导航栏不被掩盖?

提前致谢!

4

2 回答 2

3

答案可以在iPhone 上找到: Show modal UITableViewController with Navigation bar and UINavigationBar rejects to show in Modal View Controller

您需要将 包装在UIViewControllerUINavigationController,然后显示导航控制器:

AccountViewController* accountViewController = [[AccountViewController alloc] initWithNibName:@"AccountView" bundle:nil]; 
... 
// Initialize properties of accountViewController 
... 
UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:accountViewController]; 
[self.navigationController presentModalViewController:navController animated:YES]; 
[navController release]; 
[accountViewController release]; 
于 2012-10-23T22:14:00.667 回答
1
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewContorller:someViewController];
[self presentModalViewController:navController animated:YES];
于 2012-10-19T22:17:02.467 回答