Silent
Silent

Reputation: 681

Clear Background color on UIImageView?

hello i have a UIimageView with a PNG image that has round corners, image sits fine the only problem it has is that i can see the UIImage Corners with a white background, how can I make the background clear and transparent.

Upvotes: 7

Views: 16349

Answers (2)

Nick Forge
Nick Forge

Reputation: 21464

Try this:

imageView.backgroundColor = [UIColor clearColor];
imageView.opaque = NO;

You can achieve the same thing in IB by making the 'Background' a color with 0% opacity, and unticking the 'Opaque' checkbox.

Upvotes: 13

Mihir Mehta
Mihir Mehta

Reputation: 13843

try

imageView.backgroundColor = [UIColor clearColor];

Upvotes: 3

Related Questions