【发布时间】:2020-02-28 13:52:13
【问题描述】:
帮助!如何删除相交的线,让我只有外部形状?
我需要对此进行哪些更改才能删除相交线?
let width = 300
func circle(withRadius radius: CGFloat) -> UIView {
let path = UIBezierPath(arcCenter: CGPoint(x: width * (1/2), y: width * (1/3)), radius: 80, startAngle: .zero, endAngle: .pi * 2, clockwise: true)
path.append(UIBezierPath(arcCenter: CGPoint(x: width * (1/3), y: width * (2/3)), radius: 80, startAngle: .zero, endAngle: .pi * 2, clockwise: true))
path.append(UIBezierPath(arcCenter: CGPoint(x: width * (2/3), y: width * (2/3)), radius: 80, startAngle: .zero, endAngle: .pi * 2, clockwise: true))
let shapeLayer = CAShapeLayer()
shapeLayer.path = path.cgPath
shapeLayer.fillColor = UIColor.clear.cgColor
shapeLayer.strokeColor = UIColor.black.cgColor
shapeLayer.lineWidth = 3.0
backView.layer.addSublayer(shapeLayer)
return backView
}
【问题讨论】: