Why has my image lost its transparency?

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.

Answers


You may need to set the UIButton type to UIButtonTypeCustom and not Rounded Rect


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];

Need Your Help

Rendering arbitrary XHTML with JasperReports

java pdf xhtml jasper-reports flying-saucer

We have embedded JasperReports into our application to generate reports, but I've been rather dissatisfied with the way that the JEditorPaneHtmlMarkupProcessor handles writing arbitrary XHTML. For

Accessing a local text file in a WPF Application

c# wpf path text-files streamreader

I'm building an executable application from WPF in visual studio, and I have a local text file added to the project (StringList.txt) that I'm trying to read into a List object. What would the path...