Feroz
Feroz

Reputation: 699

Set transparency in image IOS

I have a table view, I have addeed image as subview for header, but that image is shown with bagckground white color,how to set transparency for image.

TIA

Upvotes: 11

Views: 22586

Answers (4)

Kamal Abuqaaud
Kamal Abuqaaud

Reputation: 1

Use image Preview in MAC

Start with a png file.

You have to go to View > Show Edit Toolbar.

Then widen the window so that you can see all of the icons.

Then click the icon that looks like a magic wand.

And then click and drag on the color you want to erase.

Upvotes: -1

Hermann Klecker
Hermann Klecker

Reputation: 14068

Assuming the name of your view is myTransparentSubView:

[myTransparentSubView setBackgroundColor:[UIColor clearColor]];

If you are using the Interface Builder then set the background Color property accordingly within IB.

Upvotes: 2

James
James

Reputation: 82136

The simplest solution is to infact to create an image with a transparent background, however, you can use an Image Mask to get the desired effect.

There is already an example of this here.

Upvotes: 0

superGokuN
superGokuN

Reputation: 1424

For this you have to set alpha of your UIImageView

Your_ImageView.alpha = 0.6;

You can also do it in your xib file

Upvotes: 14

Related Questions