Fitzy
Fitzy

Reputation: 1889

Subviews of UIView lose transparency

In my program, I have added a UIImageView as a subview of a UIView that has been declared in an xib file. This subview (which contains an image that is a PNG file) should have a transparent background, but the background becomes white when it is displayed on the screen. Is this normal behavior? Is there something I must change to allow the image to display properly? Any help is appreciated.

Upvotes: 1

Views: 390

Answers (2)

Kai Huppmann
Kai Huppmann

Reputation: 10775

Each view which should have a transparent background has to be set the background color with theUIView.backgroundcolor = [UIColor clearColor]. In your case you should call this on you image view.

Upvotes: 1

Jonathan Naguin
Jonathan Naguin

Reputation: 14796

Check the background color of your UIImageView and its container UIView.

Upvotes: 3

Related Questions