swift:view的部分圆角的实现
2019-08-13 本文已影响0人
IT界的古天乐
部分圆角:
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