【发布时间】:2020-06-04 08:07:41
【问题描述】:
我通过点击 UILabel 从 UITableviewCell 展示了一个 UINib(自定义 AlertView)。 UINib 有两个视图,一个用于自定义警报,而背景视图是通过使其透明来显示警报视图效果。
@objc func taptakeYourMedsDescriptionLabel(tapGestureRecognizer: UITapGestureRecognizer) {
let undectableVC = UndetectableAlertVC(nibName: "UndetectableAlertVC", bundle: nil)
undectableVC.view.backgroundColor = UIColor.black.withAlphaComponent(0.1)
UIApplication.shared.keyWindow?.rootViewController?.present(undectableVC, animated: true, completion: nil)
}
我还在 UndetectableAlertVC 的 viewWillAppear 中给了undectableVC.view.backgroundColor = UIColor.black.withAlphaComponent(0.1)
问题:视图在呈现时是透明的,但在呈现视图后不久,它就会变为黑色。
要求:
谁能帮我解决这个问题?
【问题讨论】: