ios 画圆
画圆:
- (void)drawRect:(CGRect)rect {
UIBezierPath *path = [UIBezierPath bezierPath];
//clockwise 为YES顺时针 为NO逆时针
[path addArcWithCenter:CGPointMake(100, 100) radius:80 startAngle:M_PI_2 * 3 endAngle:0 clockwise:YES];
[path addLineToPoint:CGPointMake(100, 100)];
[path closePath];
//移动画笔
// [path moveToPoint:CGPointMake(100, 180)];
// [path addArcWithCenter:CGPointMake(100, 100) radius:80 startAngle:M_PI_2 endAngle:M_PI clockwise:YES];
// [path addLineToPoint:CGPointMake(100, 100)];
// [path closePath];
path.lineWidth = 8;
[[UIColor redColor] setStroke];
[path stroke];
[[UIColor greenColor] setFill];
[path fill];
}
成功的三大原则:
1、坚持
2、不要脸
3、坚持不要脸