本文介绍了在 iOS 13 全屏中呈现模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 iOS 13 中,模态视图控制器在呈现时具有新的行为.
In iOS 13 there is a new behaviour for modal view controller when being presented.
现在它默认不是全屏的,当我尝试向下滑动时,应用程序会自动关闭视图控制器.
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,如 Platforms State of the Union 在 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 全屏中呈现模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!