I am trying to implement a custom view. This view should display an image surrounded by a gray rectangular rectangular border. However, I can get the image to display it as well as the border, since the border has rounded corners. I need a way to clear these corners so that they correctly display everything that is beyond the point of view. How can i do this?
It looks like I could use a CGContextClearRect , but then I would not need to call it several times, reconstructing the area outside my rounded corner? That sounds too complicated.
Is there a better way to create this view?
Here is my current code:
- (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext();
iphone core-graphics drawing
Sebastian celis
source share