UIBezierPath基本使用

时间:2024-08-19 12:36:20

UIBezierPath * aPath = [UIBezierPath bezierPathWithArcCenter:point radius:5 startAngle:0 endAngle:2 * 3.14 clockwise:YES];

aPath.lineWidth = 1;

aPath.lineCapStyle = kCGLineCapRound; //线条拐角

aPath.lineJoinStyle = kCGLineCapRound; //终点处理

//设置填充颜色

[[UIColor whiteColor]setFill];

//设置线的颜色

[[UIColor colorWithRed:1.00f green:0.36f blue:0.00f alpha:1.00f] setStroke];

[aPath stroke];

[aPath fill];

//小圆

UIBezierPath * Path = [UIBezierPath bezierPathWithArcCenter:point radius:2 startAngle:0 endAngle:2 * 3.14 clockwise:YES];

Path.lineWidth = 1;

Path.lineCapStyle = kCGLineCapRound; //线条拐角

Path.lineJoinStyle = kCGLineCapRound; //终点处理

[[UIColor colorWithRed:1.00f green:0.36f blue:0.00f alpha:1.00f] setFill];

[Path stroke];

[Path fill];