全屏显示iOS 13中的模态 [英] Presenting modal in iOS 13 fullscreen
本文介绍了全屏显示iOS 13中的模态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在iOS 13中,出现模态视图控制器时有新行为.
In iOS 13 there is a new behaviour for modal view controller when being presented.
现在默认情况下它不是全屏显示,当我尝试向下滑动时,该应用程序会自动关闭View Controller.
Now it's not fullscreen by default and when I try to slide down, the app just dismiss the View Controller automatically.
如何防止这种行为并回到旧的全屏模式vc?
How can I prevent this behaviour and get back to the old fullscreen modal vc?
谢谢
推荐答案
对于iOS 13,如平台国情咨文在WWDC 2019期间,Apple推出了新的默认卡演示文稿.为了强制全屏,您必须使用以下命令明确指定它:
With iOS 13, as stated in the Platforms State of the Union during the WWDC 2019, Apple introduced a new default card presentation. In order to force the fullscreen you have to specify it explicitly with:
let vc = UIViewController()
vc.modalPresentationStyle = .fullScreen //or .overFullScreen for transparency
self.present(vc, animated: true, completion: nil)
这篇关于全屏显示iOS 13中的模态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文