我在tableview
创建了一个简单的弹出框,但我不知道如何让子视图透明,现在它是全黑的。
这就是我在tableview单元格按钮中创建弹出窗口的方法:
let vc = self.storyboard?.instantiateViewController(withIdentifier: "RatingViewController") as! RatingViewController
vc.modalPresentationStyle = .popover
vc.preferredContentSize = CGSize(200, 100)
if let presentationController = vc.popoverPresentationController {
presentationController.delegate = self
presentationController.permittedArrowDirections = .up
presentationController.sourceView = self.view
presentationController.sourceRect = CGRect(0, 0, 50, 50)
self.present(vc, animated: true, completion: nil)
}
我该怎么做才能让它变得透明?我对RatingViewController的子视图是白色的,但由于某种原因它显示为黑色。