2011-04-12 45 views
6

我想设置我的UIModalPresentationFormSheet风格模式的看法,成为UIModalPresentationFullScreen风格的某个时候,但是当它已经与UIModalPresentationFormSheet风格所示,它使用的代码不能转到全屏“[xx setModalPresentationStyle:UIModalPresentationFullScreen];如何在已经显示模态视图控制器时更改modalPresentationStyle?

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

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. 

回答

0

不知道这是否是答案,但你有没有试过通过modalViewController访问控制器?

喜欢的东西:

[self.modalViewController setModalPresentationStyle:UIModalPresentationFullScreen]; 

,而不是:

[nav setModalPresentationStyle:UIModalPresentationFullScreen]; 
+0

这将不会产生任何效果 – jyavenard 2012-01-11 08:25:54

0

我想,你可以尝试改变modalpresentationStyleUIModalPresentationPageSheet

[nav setModalPresentationStyle:UIModalPresentationPageSheet]; 

这种类型应该自动旋转你的模式视图

0

这对我来说仍然是一个iOS 7应用程序中的问题,在这一点上我只能得出结论:在发生转换后更改modalPresentationStyle只是没有效果。

相关问题