swift:view的部分圆角的实现

部分圆角:

let maskPath = UIBezierPath(roundedRect: imgView.bounds,byRoundingCorners:[.topLeft,.topRight],cornerRadii: CGSize(width: 5,height: 5))       

let maskLayer = CAShapeLayer()       

maskLayer.frame = imgView.bounds       

maskLayer.path = maskPath.cgPath       

imgView.layer.mask = maskLayer

你可能感兴趣的:(swift:view的部分圆角的实现)