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实现视图的部分圆角效果,通过创建UIBezierPath并指定需要圆角化的角及圆角半径,然后利用CAShapeLayer作为mask层应用到目标视图上。
3239

被折叠的 条评论
为什么被折叠?



