呈现 ViewController 的问题

时间:2021-07-01 07:04:38

标签: ios swift uiviewcontroller

我使用 UIViewcontroller 作为自定义在屏幕上显示警报, 这个视图控制器只包含一个自定义的静态高度和约束弹出窗口,添加到前导、尾随和底部,值为 0 常量,

它从底部呈现得很好,但是当它呈现出来时,它显示了一个透明的黑色背景,并与我的弹出窗口一起呈现,即使我将父视图背景设置为清晰的颜色 enter image description here enter image description here

我只想将弹出视图滑动到幻灯片中

我该怎么做,请查看视频以供参考

1 个答案:

答案 0 :(得分:0)

试试这个

let viewController = yourVC.instantiate(.customStoryboard)
viewController.modalPresentationStyle = .overFullScreen
viewController.view.backgroundColor = .clear
present(viewController, animated: true, completion: nil)
相关问题