Estoy tratando de obtener un fondo transparente en CG pero sigue saliendo en negro.Fondo transparente en CoreGraphics
tengo el siguiente código:
- (id)initWithFrame:(CGRect)frame {
if ((self = [super initWithFrame:frame])) {
DLog(@">>> Alloc: DrawingCanvas [0x%X]", (unsigned int)self);
[self setOpaque:NO];
[self setBackgroundColor:[UIColor clearColor]];
}
return self;
}
- (void) drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGRect frame = rect;
int counter = 3;
CGContextClearRect(context, frame);
CGContextSetFillColorWithColor(context, [UIColor clearColor].CGColor);
CGContextFillRect(context, frame);
}
¿Cómo puedo obtener el código para mostrar un fondo transparente?
¿Encontró una solución? Si es así, por favor, compártala respondiendo su propia pregunta. –