快速旋转贝塞尔曲线路径圆中的笔触边缘 [英] Rounding the edges of a stroke in bezier path circle in swift

查看:52
本文介绍了快速旋转贝塞尔曲线路径圆中的笔触边缘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 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

这篇关于快速旋转贝塞尔曲线路径圆中的笔触边缘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆