【发布时间】:2013-08-14 20:50:08
【问题描述】:
我正在尝试使用 Core Graphics 绘制两个同心圆。我希望下面的代码在里面绘制一个蓝色圆圈和一个较小的白色圆圈,但是它只绘制蓝色圆圈。我错过了什么?
CGContextRef c = UIGraphicsGetCurrentContext();
CGContextAddArc(c, self.bounds.size.width/2, self.bounds.size.height/2, 100, 0, M_PI * 2, true);
CGContextSetFillColor(c, CGColorGetComponents([[UIColor blueColor] CGColor]));
CGContextFillPath(c);
CGContextAddArc(c, self.bounds.size.width/2, self.bounds.size.height/2, 90, 0, M_PI * 2, true);
CGContextSetFillColor(c, CGColorGetComponents([[UIColor whiteColor] CGColor]));
CGContextFillPath(c);
【问题讨论】:
标签: core-graphics