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

2018-01-15  本文已影响32人  qiushuitian
    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
上一篇 下一篇

猜你喜欢

热点阅读