UIBezierPath maskPath = UIBezierPath bezierPathWithRoundedRectselfbackViewbounds byRoundingCornersUIRectCornerTopLeft UIRectCornerTopRight UIRectCornerBottomRight cornerRadiiCGSizeMakeselfbackViewfr
let maskPath = UIBezierPath(roundedRect: self.backView.bounds, byRoundingCorners: [.topLeft, .topRight, .bottomRight], cornerRadii: CGSize(width: self.backView.frame.size.height/2.0, height: applyLabel.frame.size.height/2.0)) let maskLayer = CAShapeLayer() maskLayer.frame = self.backView.bounds maskLayer.path = maskPath.cgPath self.backView.layer.mask = maskLayer
原文地址: http://www.cveoy.top/t/topic/hIfP 著作权归作者所有。请勿转载和采集!