美文网首页
【iOS】UIBezierPath 绘图

【iOS】UIBezierPath 绘图

作者: 印比八方来 | 来源:发表于2018-10-07 09:29 被阅读0次

一.根据点、半径画圆

// 圆圈
SEL colorSelector = NSSelectorFromString(self.stepModel.color);
UIBezierPath *backCircle = [UIBezierPath bezierPathWithArcCenter:CGPointMake(_radius+5 ,self.bounds.size.height / 2)
                                                        radius:_radius
                                                    startAngle:(CGFloat) -M_PI_2
                                                      endAngle:(CGFloat)(1.5 * M_PI)
                                                     clockwise:YES];

UIColor *pathColor = [UIColor performSelector:colorSelector withObject:nil];
[pathColor setStroke];
backCircle.lineWidth = 2;
[backCircle stroke];

相关文章

网友评论

      本文标题:【iOS】UIBezierPath 绘图

      本文链接:https://www.haomeiwen.com/subject/wiokaftx.html