ios - 在 iOS 13 全屏中呈现模态

标签 ios viewcontroller modalviewcontroller ios13

在 iOS 13 中,模态视图 Controller 在呈现时有一个新行为。

现在默认情况下它不是全屏的,当我尝试向下滑动时,应用程序会自动关闭 View Controller 。

如何防止这种行为并返回到旧的全屏模式 vc?

modal behaviour

谢谢

最佳答案

使用 iOS 13,如 Platforms State of the Union 中所述在 WWDC 2019 期间,Apple 推出了新的默认卡片演示。为了强制全屏,您必须明确指定它:

let vc = UIViewController()
vc.modalPresentationStyle = .fullScreen //or .overFullScreen for transparency
self.present(vc, animated: true, completion: nil)

关于ios - 在 iOS 13 全屏中呈现模态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56435510/

相关文章:

ios - Xcode 6.1。取消选中并重新选中纵向方向。模拟器永远不会出现在纵向模式下

ios - 带有 NSTimers 和服务器调用的后台模式

ios - 在 segue 之后关闭 View Controller

ios - 将数据从一个 ViewController 发送到另一个。

ios - 显示 MPMediaPickerController 模态后状态栏再次出现

iphone - 显示模态视图 Controller 时设备旋转

ios - UIWebView的动态高度

ios - 核心数据 - NSPredicate 过滤掉工作不正确的空字符串

ios - 将字符串从 TableView Controller 传递到新 View Controller

iOS - 半透明模态视图 Controller