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

ios – 如何在显示模态视图控制器时更改modalPresentationStyle?,第1张

概述我希望将我的UIModalPresentationFormSheet样式模式视图设置为UIModalPresentationFullScreen样式,但是当它已经显示为UIModalPresentationFormSheet样式时,它无法使用代码“[xx setModalPresentationStyle:UIModalPresentationFullScreen];”转到全屏模式. 在显示模态视 我希望将我的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.
解决方法 不确定这是不是答案,但您是否尝试通过modalVIEwController访问控制器?

就像是:

[self.modalVIEwController setModalPresentationStyle:UIModalPresentationFullScreen];

而不是:

[nav setModalPresentationStyle:UIModalPresentationFullScreen];
总结

以上是内存溢出为你收集整理的ios – 如何在显示模态视图控制器时更改modalPresentationStyle?全部内容,希望文章能够帮你解决ios – 如何在显示模态视图控制器时更改modalPresentationStyle?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/web/1099658.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存