
class ovalLayer: CAShapeLayer { let animationDuration: CFTimeInterval = 0.3 overrIDe init() { super.init() fillcolor = colors.green.CGcolor path = ovalPathSmall.CGPath } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") }var ovalPathStart: UIBezIErPath { let path = UIBezIErPath(ovalInRect: CGRect(x: 0.0,y: 0.0,wIDth: 100.0,height: 100.0)) return path }}解决方法 您可以使用以下方法制作所有角落视图… UIBezIErPath(roundedRect: anyVIEw.bounds,cornerRadius: CGSize(wIDth: 10.0,height: 10.0))
如果你想要特定的角落在下面的方法使用.
UIBezIErPath(roundedRect: anyVIEw.bounds,byRoundingCorners: .Bottomleft | .Bottomright,height: 10.0))总结
以上是内存溢出为你收集整理的ios – 如何为UIBezierPath提供cornerRadius全部内容,希望文章能够帮你解决ios – 如何为UIBezierPath提供cornerRadius所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)