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.
现在它默认不是全屏的,当我尝试向下滑动时,应用程序会自动关闭视图控制器.
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 全屏中呈现模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 iOS 13 全屏中呈现模式
基础教程推荐
- iOS4 创建后台定时器 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
