快速旋转贝塞尔曲线路径圆中的笔触边缘

问题描述:

我正在尝试使用 UIBezierPath(ovalInRect:CGRectMake())画一个圆.然后,我将更改 strokeEnd 属性.发生这种情况时,圆线的任一端都有尖角.有什么办法可以消除这些角落?

I'm trying to draw a circle using UIBezierPath(ovalInRect: CGRectMake()). Then I'll change the strokeEnd property. When this happens, either end of the circular line have sharp corners. Is there any way to round out these corners?

(我想使这条线的起点和终点弯曲)

(I would like to make the beginning and end of this line curved)

假设您使用的是 CAShapeLayer 进行绘制,只需设置 lineCap ,例如:>

Assuming you are using a CAShapeLayer to draw this, just set the lineCap, e.g.:

layer.lineCap = .round