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/56712628/

相关文章:

ios - ARSKView 在关闭 ViewController 时不释放内存

ios - 代码中的自动布局约束与 XIB 中的大小冲突

ios - 为什么我的 UISwipeGestureRecognizer 出现这个错误?

ios - 从 IB 加载后调整 UIView 的框架

ios - 如何在 iOS 上的 View 之间进行展开/收缩转换?

objective-c - 带有 ModalPresentationStyle 的 Popover 在 iOS 7 iPad 中不居中

ios - 如何从 UIAlertcontroller 中关闭模态 ViewController

ios - 当我在我的一个文件夹中创建一个新的 viewController 时,该 Controller 包含在一个名为 : ctive-C 的文件夹中

ios - 默认的 ViewControllers 名称来自哪里?

ios - 准备ForSegue( View Controller )