【发布时间】:2016-08-29 01:54:42
【问题描述】:
以下是从M_PI/2 到M_PI 绘制弧线的代码。
CGContextRef contet=UIGraphicsGetCurrentContext();
CGMutablePathRef path = CGPathCreateMutable();
CGPathAddArc(path, NULL, CGRectGetMidX(rect), CGRectGetMidY(rect), CGRectGetMidX(rect), M_PI/2.0,M_PI, YES);
CGContextAddPath(contet, path);
CGContextSetStrokeColorWithColor(contet, [UIColor redColor].CGColor);
CGContextStrokePath(content);
下面是上面代码的图。
我期待它按照顺时针方向将其绘制在空白或缺失部分中。我提到了这个答案Why does giving addArcWithCenter a startAngle of 0 degrees make it start at 90 degrees? 但是,我不知道我错在哪里。
【问题讨论】:
标签: ios objective-c cgcontext cgpath