Reputation: 4870
I'm creating a xib file in which there is a black marbled background displayed using a UIImageView and several UIButtons placed over it with images within them. The images are transparent with the exception of a dotted white line skirting their perimeter. I am using pngs for my images and I have tried setting them as both the image and background image. How can I restore the alpha channel within these images and place them within a UIButton?
How the image should look with transparency against a black marbled background.
How the image looks at present.
Upvotes: 0
Views: 172
Reputation: 2253
Try to add quartzCore framework in your framework folder, then import the header:
#import < QuartzCore/QuartzCore.h >
and set the image maskToBounds
yes and set in corner if you want.
[yuorImageView.layer setMaskToBounds:YES];
Upvotes: 0
Reputation: 5314
You may need to set the UIButton
type to UIButtonTypeCustom
and not Rounded Rect
Upvotes: 3