当我以模态方式呈现 View Controller 时:
// Display the nav controller modally.
[self presentModalViewController:theNavController animated:YES];
导航栏被弹出的 View 遮住了! 如何让导航栏不被遮挡??
提前致谢!
最佳答案
答案可以在 iPhone: Show modal UITableViewController with Navigation bar 找到 和 UINavigationBar refuses to show in Modal View Controller !
您需要将 UIViewController
包装在 UINavigationController
中,然后呈现导航 Controller :
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];
关于iphone - 模态呈现的 TableView 没有导航栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12982916/