小编dou*_*dou的帖子

如何在显示模态视图控制器时更改modalPresentationStyle?

我希望将我的UIModalPresentationFormSheet样式模态视图设置为UIModalPresentationFullScreen某个时候的样式,但是当它已经显示为UIModalPresentationFormSheet样式时,它无法使用代码" [xx setModalPresentationStyle:UIModalPresentationFullScreen];" 转到全屏模式.

在显示模态视图后,有没有办法改变现在的风格?我的代码是这样的:

UITableDownload* vc = [[UITableDownload alloc] initWithStyle:UITableViewStylePlain];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
[nav setModalPresentationStyle:UIModalPresentationFormSheet];
[MainAppDelegate mainBrowserViewController] presentModalViewController:nav animated:YES];

...//after shown,sometime I implement following code:
[nav setModalPresentationStyle:UIModalPresentationFullScreen];//(The "nav" object is the same as above code)
//But the change style code takes no effect.
Run Code Online (Sandbox Code Playgroud)

ios

7
推荐指数
1
解决办法
2757
查看次数

标签 统计

ios ×1