美文网首页
swift:view的部分圆角的实现

swift:view的部分圆角的实现

作者: IT界的古天乐 | 来源:发表于2019-08-13 14:31 被阅读0次

部分圆角:

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的部分圆角的实现

      本文链接:https://www.haomeiwen.com/subject/ayavjctx.html