UIVisualEffectView底角半径

时间:2015-12-24 09:56:52

标签: swift2 mask cornerradius uivisualeffectview

我正在尝试将掩码应用到UIVisualEffectView以使底角变圆,但由于某种原因我有错误"表达式类型不明确而没有更多上下文"在这里".BottomRight | .BottomLeft"

第二个问题是如果我只做一个圆角,那么UIVisualEffectView约束就会出错

enter image description here

@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
}

如何解决这个问题? 感谢

0 个答案:

没有答案