在 iOS 13 全屏中呈现模式

Presenting modal in iOS 13 fullscreen(在 iOS 13 全屏中呈现模式)
本文介绍了在 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 全屏中呈现模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Why local notification is not firing for UNCalendarNotificationTrigger(为什么没有为UNCalendarNotificationTrigger触发本地通知)
iOS VoiceOver functionality changes with Bundle Identifier(IOS画外音功能随捆绑包标识符而变化)
tabbar middle tab out of tabbar corner(选项卡栏中间的选项卡角外)
Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Get an event when UIBarButtonItem menu is displayed(显示UIBarButtonItem菜单时获取事件)