首页 > 解决方案 > 防止视图控制器堆叠 IOS 13 (swift)

问题描述

我正在开发一个应用程序,最近更新到我的 Xcode。通过此更新,视图控制器的呈现方式发生了变化,我想将其恢复为旧方式。他们过去常常显示在其他人之上,但现在他们“堆叠”了。

我想要左边的 iPhone,而我目前拥有的是右边的 iPhone。 在此处输入图像描述谢谢。

标签: iosswiftxcodeios13

解决方案


您只需要将呈现的视图控制器 modalPresentationStyle 更改为全屏。

let myModalController = MyModalController()
myModalController.modalPresentationStyle = .overFullScreen
self.present(myModalController, animated: true, completion: nil)

推荐阅读