部分圆角:
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
网友评论