2015-12-11 53 views
0

我需要在iOS中使用UIBezierPath来绘制加载图形,如下图所示。任何人都可以向我建议如何做到这一点?UIBezierpath绘制加载圈

我需要装载图形像 “svprogresshud”

enter image description here

回答

0

试试这个,你会得到一些想法。

UIBezierPath *bezierPath = [UIBezierPath bezierPath]; 
[bezierPath addArcWithCenter:center radius:50 startAngle:0 endAngle:2 * M_PI clockwise:YES]; 
CAShapeLayer *progressLayer = [[CAShapeLayer alloc] init]; 

[progressLayer setPath:bezierPath.CGPath]; 
[progressLayer setStrokeColor:[UIColor colorWithWhite:1.0 alpha:0.2].CGColor]; 
[progressLayer setFillColor:[UIColor clearColor].CGColor]; 
[progressLayer setLineWidth:0.3 * self.bounds.size.width]; 
[progressLayer setStrokeEnd:volume/100]; 
[_circleView.layer addSublayer:progressLayer]; 
+0

根据你的改变UI。 –