I just want to draw a simple rectangle for presentation using the following function:
- (void)drawRect:(CGRect)rect { [super drawRect:rect]; if (self.drawTextBouble) { [[UIColor blueColor] setFill]; UIBezierPath *aPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(40, 0, 230, 120) cornerRadius:12.0]; [aPath fill]; } }
The code above fills the view with a plain black background; outside the rectangle, it is not transparent. How can i fix this?
Edit:
The solution below works, but it also works:
[self setOpaque:NO]
flatronka
source share