Prerna chavan
Prerna chavan

Reputation: 3249

Draw bezier curve above image of UIImageView

How to draw beziercurve above the image of the UIImageView. I am subclassing UIImageView and drawing circles using UIBezierCurve on the corners of image view. But as soon as i place the image in UIImageView the inside part of circles are overlapped by the image. So is there any solution which lets me draw the UIBezier path on the UIimage of uiimageview ?

Upvotes: 2

Views: 1566

Answers (1)

Eimantas
Eimantas

Reputation: 49354

You can try subclassing simple UIView and drawing an image yourself using drawInRect: method of UIImage instance. It should look something like this:

- (void)drawRect:(CGRect)dirtyRect {
    // note you can get image from anywhere
    UIImage *image = [UIImage imageNamed:@"MyImage"];

    [image drawInRect:self.bounds];

    // now that image is drawn, everything
    // past this point will be drawn on top of it
    ...
}

Upvotes: 2

Related Questions