Dibuja un círculo con UIBezierPath
Estoy tratando de dibujar un círculo con el método UIBezierPath addArcWithCenter:
UIBezierPath *bezierPath =
[UIBezierPath bezierPathWithOvalInRect:CGRectMake(0., 0., 100., 100.)];
[bezierPath addArcWithCenter:center
radius:0.
startAngle:0 endAngle:2 * M_PI clockwise:YES];
CAShapeLayer *progressLayer = [[CAShapeLayer alloc] init];
[progressLayer setPath:bezierPath.CGPath];
[progressLayer setStrokeColor:[UIColor colorWithWhite:1. alpha:.2].CGColor];
[progressLayer setFillColor:[UIColor clearColor].CGColor];
[progressLayer setLineWidth:.3 * self.bounds.size.width];
[progressLayer setStrokeStart:_volumeValue/100.];
[progressLayer setStrokeEnd:volume/100.]; // between 0 and 100
[_circleView.layer addSublayer:progressLayer];
pero lo que obtengo es lo siguiente:
Traté de jugar con los diferentes parámetros pero no tuve suerte
Gracias
ACTUALIZACIÓN
Lo siento si no expliqué lo que estoy tratando de hacer:
* El círculo de fondo se dibuja usando:
[UIBezierPath bezierPathWithOvalInRect:CGRectMake(0., 0., 100., 100.)]
* Estoy tratando de dibujar el círculo rojo paso a paso usando bezierPathWithOvalInRect entre 2 valores: _volumeValue y volume
Pero no puedo obtener un círculo perfecto, en cambio obtengo la parte del horizonte después de cierto valor.