提出模态视图控制器

时间:2012-08-16 19:37:14

标签: objective-c modalviewcontroller

我有这个:

SomeViewController* vc = [[SomeViewController alloc] init];
self.view.backgroundColor = [UIColor clearColor];
self.modalPresentationStyle = UIModalPresentationCurrentContext;
[self presentModalViewController:vc animated:YES];

出现空白黑屏 - 如何解决?有什么想法吗?

2 个答案:

答案 0 :(得分:0)

它似乎不是视图控制器的有效初始值设定项。 use - initWithNibName:bundle:如果你的子类是UIViewController的直接子类

答案 1 :(得分:0)

这里的派对迟到了,但是如果你从带有UINavigationController的vc初始化这个模态视图控制器,请尝试在UINavigationController上设置modalPresentationStyle:

self.navigationController.modalPresentationStyle = UIModalPresentationCurrentContext;