1

我知道怎么画圆 // 绘图代码

CGContextClearRect(UIGraphicsGetCurrentContext(), rect);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetLineWidth(context, 1.0f);

CGContextSetFillColorWithColor(context, [UIColor colorWithRed:0 green:0.5 blue:0 alpha:0.5].CGColor);
CGRect circlePoint = CGRectMake(startX, startY, circleDiameter, circleDiameter);
CGContextFillEllipseInRect(context, circlePoint);//
CGContextSetStrokeColorWithColor(context, [UIColor blackColor].CGColor);
CGContextStrokeEllipseInRect(context, circlePoint);

但是我怎么能画一条带渐变的线/圆,从黑色淡入到白色(也可能在另一边从白色淡出到黑色)?

4

0 回答 0