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

标签 ios viewcontroller modalviewcontroller ios13

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

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

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

modal behaviour

谢谢

最佳答案

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

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

相关文章:

ios - 在容器 View 中交换 View Controller

ios - 类型 'ViewController' 不符合协议(protocol)

ios - 如何将 mask 应用于后端 View ?

iphone - View Controller 堆栈

ios - Swift 中的电子邮件和电话验证

ios - 如何获取一周内每一天的顺序?

ios - 如何从 TabBarController 内的 NavBarController 显示 ViewController Storyboard元素

ios - 如何在 SpriteKit SKScene 类中启动 ReplayKit 屏幕录制

iphone - 将 UIGesture 转发到后面的 View

iPhone 模态视图 Controller 和设备方向