// 创建路径
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画线
最新推荐文章于 2024-05-24 09:53:04 发布