iOS 视图画半圆

2017-03-24  本文已影响0人  Still4ever幺惊云

let  maskPath = UIBezierPath.init(roundedRect: box, byRoundingCorners: [.topRight,.topLeft], cornerRadii: CGSizeMake(width: 6.0, height: 6.0))

let maskLayer = CAShapeLayer()

maskLayer.frame = self.bgView.bounds

maskLayer.path = maskPath.cgPath

self.bgView.layer.mask = maskLayer

上一篇下一篇

猜你喜欢

热点阅读