Search code examples
iphoneiosxcodeipadipod

Transparent UIImage


I am creating an iOS application in which I have added a simple UIImage. I want to add the transparency effect in image to show other images behind that main image. Tell me how I can achieve this effect?

Note: I don't want to change the opacity/alpha of image.


Solution

  • An alpha change is how you alter transparency. In addition to this, you would want to alter this on the view level not on to the UIImage directly. E.x:

    [myImageView setImage:[UIImage imageNamed@"myImage.png"]];
    [myImageView setAlpha:0.7f];