简体   繁体   中英

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

For this you have to set alpha of your UIImageView

Your_ImageView.alpha = 0.6;

You can also do it in your xib file

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.

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 .

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM