当我以模态方式呈现视图控制器时:
// 模态显示导航控制器。
[self presentModalViewController:theNavController Animation:YES];
导航栏被遮住了弹出的视图!我怎样才能让导航栏不被掩盖?
提前致谢!
当我以模态方式呈现视图控制器时:
// 模态显示导航控制器。
[self presentModalViewController:theNavController Animation:YES];
导航栏被遮住了弹出的视图!我怎样才能让导航栏不被掩盖?
提前致谢!
答案可以在iPhone 上找到: Show modal UITableViewController with Navigation bar and UINavigationBar rejects to show in Modal View Controller!
您需要将 包装在UIViewController
中UINavigationController
,然后显示导航控制器:
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];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewContorller:someViewController];
[self presentModalViewController:navController animated:YES];