0
我必须填写与渐变颜色只在弧弧你可以在任何一个提供解决方案enter image description here梯度层改变UIbezierpath弧IOS
CGContextRef ctx = UIGraphicsGetCurrentContext();
UIBezierPath *arc = [UIBezierPath bezierPathWithArcCenter:barCenter radius:barRadius startAngle:fmodf(MIN_ANGLE+M_PI, 2*M_PI) endAngle:fmodf(MAX_ANGLE+M_PI, 2*M_PI) clockwise:YES];
CGContextSetLineCap(ctx, kCGLineCapRound);
CGContextSetLineWidth(ctx, kArcThickness);
CGContextSetGrayStrokeColor(ctx, 0.6, 1.0);
CGContextAddPath(ctx, arc.CGPath);
CGContextStrokePath(ctx);
// knob to move the slider
CGContextSetLineWidth(ctx, 2.0);
CGContextSetFillColorWithColor(ctx, [UIColor whiteColor].CGColor);
CGContextAddArc(ctx, knobCenter.x, knobCenter.y, knobRadius, 0, 2*M_PI, 1);
CGContextDrawPath(ctx, kCGPathFill);
你需要什么输出..? –
我需要一个线宽为10的弧线,并且该弧线颜色需要为渐变色 –