【问题标题】:Issue with presenting ViewController呈现 ViewController 的问题
【发布时间】:2021-09-13 06:13:00
【问题描述】:
我使用 UIViewcontroller 作为自定义在屏幕上显示警报,
这个视图控制器只包含一个静态高度和约束的自定义弹出窗口,添加到前导、尾随和底部,常量值为 0,
它从底部显示得很好,但是当它显示时它显示一个透明的黑色背景与我的弹出窗口一起显示,即使我将父视图背景设置为清晰的颜色
enter image description here
我只想将弹出视图滑动到幻灯片中
我该怎么做,请查看视频以供参考
【问题讨论】:
标签:
ios
swift
uiviewcontroller
【解决方案1】:
试试这个
let viewController = yourVC.instantiate(.customStoryboard)
viewController.modalPresentationStyle = .overFullScreen
viewController.view.backgroundColor = .clear
present(viewController, animated: true, completion: nil)