// 创建路径
UIBezierPath *currenPath = [UIBezierPath bezierPath];
currenPath.lineCapStyle = kCGLineCapRound;
currenPath.lineJoinStyle = kCGLineJoinRound;
currenPath.lineWidth = 6;
// 设置起点
[currenPath moveToPoint:startPos];
//...
[currentPath addLineToPoint:pos];
[self setNeedsDisplay];
//在drawRect里面, 调用stroke 画出来
[currentPath stroke];iOS 使用UIBezierPath画线
最新推荐文章于 2021-11-22 16:09:14 发布
本文详细介绍了如何使用UIBezierPath在iOS应用中绘制路径,包括设置路径样式、定义起点和添加路径点的方法。
3464

被折叠的 条评论
为什么被折叠?



