Estoy tratando de dibujar dos círculos uno dentro del otro como la imagen de abajo.dibujando dos círculos usando Quartz CGContextFillEllipseInRect
he logrado dibujar un círculo (la externa) muy bien, pero no estoy seguro de cómo agregar el segundo círculo en la parte superior, y la forma de centrarla.
- (void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetLineWidth(context, 4.0);
CGContextSetStrokeColorWithColor(context,
[UIColor whiteColor].CGColor);
//
UIColor *theFillColor = UIColorFromRGB(0x6c83a6);
CGContextSetFillColor(context, CGColorGetComponents(theFillColor.CGColor));
CGRect rectangle = CGRectMake(5.0,5.0,rect.size.width-10.0,rect.size.height-10.0);
CGContextAddEllipseInRect(context, rectangle);
CGContextStrokePath(context);
CGContextFillEllipseInRect(context, rectangle);
UIGraphicsEndImageContext();
//
// INSIDE ?
//
}
Hey SCH, gracias por la respuesta, debe cambiar en la respuesta anterior "CGContextDrawPath (contexto, kCGPathFill);" en ambos casos, pero aparte de eso, funciona bien. – chewy
Sí, me olvidé de eso. También puede usar 'kCGPathFillStroke' si desea llenar y acariciar. – sch