我有一个位于弹出框内的视图控制器,我想从中呈现一个模态视图控制器。这是我的代码:
EditDateViewController *dateViewController = [[EditDateViewController alloc] initWithNibName:@"EditDateViewController" bundle:[NSBundle mainBundle]];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:dateViewController];
navController.modalPresentationStyle = UIModalPresentationCurrentContext;
[self presentModalViewController:navController animated:YES];
[dateViewController release];
[navController release];
结果如下:
alt text http://cl.ly/5300e4f8f5d440d3f850/content
出于某种原因,导航栏背景是透明的(或黑色?),即使我没有这样配置。我尝试在模态视图控制器的tintColor
方法中手动设置导航栏的viewDidLoad
属性,但它没有效果。
答案 0 :(得分:4)
试试这个
dateViewController.modalInPopover=YES;
self.navigationController.modalInPopover=YES;