在NavigationController之上的Modal ViewController

时间:2014-03-20 10:33:57

标签: uiviewcontroller uinavigationcontroller modal-dialog

我试图在navigationBar和rootView上添加一个menuViewController。

menuView = [[MenuViewController alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width*0.4, self.view.frame.size.height)];
UIViewController *rootViewController = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
rootViewController.modalPresentationStyle = UIModalPresentationFullScreen;
[[self navigationController] presentViewController:menuView animated:YES completion:nil];

这是我的代码,但动画后视图变黑。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

尝试使用UIModalPresentationCurrentContext代替UIModalPresentationFullScreen