Swift 画半圆

let circle = UIBezierPath(arcCenter:   CGPoint(x: 100, y: 100), radius: 30, startAngle: CGFloat(0), endAngle: CGFloat(Double.pi), clockwise: true)

        let shapeLayer = CAShapeLayer()

        shapeLayer.path = circle.cgPath

//        shapeLayer.fillColor = UIColor.white.cgColor

        

        shapeLayer.strokeColor = UIColor.red.cgColor

        shapeLayer.lineWidth = 10

        view.layer.addSublayer(shapeLayer)

 

 

 

posted @ 2017-11-16 14:49  小炮陈  阅读(1458)  评论(0编辑  收藏  举报