我正在尝试应用蒙版以UIVisualEffectView
使底角变圆,但由于某种原因,我在这里遇到错误“表达式类型不明确而没有更多上下文”".BottomRight | .BottomLeft"
第二个问题是如果我只做一个圆角,那么UIVisualEffectView
约束就会出错
@IBOutlet weak var visualEffect: UIVisualEffectView!
override func awakeFromNib() {
super.awakeFromNib()
let rectShape = CAShapeLayer()
rectShape.bounds = self.visualEffect.frame
rectShape.position = self.visualEffect.center
rectShape.path = UIBezierPath(roundedRect: self.visualEffect.bounds, byRoundingCorners: .BottomRight | .BottomLeft, cornerRadii: CGSize(width: 10, height: 10)).CGPath
self.visualEffect.layer.mask = rectShape
}
如何解决这个问题?谢谢