美文网首页
[那些似懂非懂的细节]绘制弧形的View

[那些似懂非懂的细节]绘制弧形的View

作者: qiushuitian | 来源:发表于2018-01-15 02:13 被阅读32次
    bottomView.backgroundColor = UIColor.white
    let topLayer = CAShapeLayer()
    let rd = 400.0 as CGFloat;
    let pathRadius = UIBezierPath(arcCenter: CGPoint(x:UIScreen.main.bounds.width / 2,y:rd),
                                  radius: rd,
                                  startAngle: 0,
                                  endAngle: CGFloat.pi,
                                  clockwise: false)
    topLayer.path = pathRadius.cgPath
    bottomView.layer.mask = topLayer

相关文章

网友评论

      本文标题:[那些似懂非懂的细节]绘制弧形的View

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