在模态呈现的视图控制器中呈现模态视图控制器

时间:2016-02-18 12:21:55

标签: uiviewcontroller ios8 xcode7 modalviewcontroller

如何让模态呈现的视图控制器以模态方式呈现另一个视图控制器?我尝试使用presentViewController调用另一个模态视图控制器,但视图控制器没有出现。

e.g。

从模态呈现的视图控制器中:

MessageViewController *vc = [[MessageViewController alloc] initWithType:type];

vc.modalPresentationStyle = UIModalPresentationFullScreen;
vc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;

// Modal view does not appear
[self presentViewController:vc animated:YES completion:nil];

1 个答案:

答案 0 :(得分:0)

当您呈现视图控制器时,将设置视图控制器的属性。

presentedViewController将被设置。您需要在presentViewController:animated:completion:之上致电presentedViewController。您无法在已呈现的视图控制器上显示。

相关问题