Reputation: 14317
I have this PNG image: (the area in the grey borders is transparent)
I would like only the grey corners to have alpha of 0.5
If I set
[imgView setAlpha:0.5f];
Also the transparent area in the middle retrieves a semi-white color.
How can I do it?
Upvotes: 0
Views: 184
Reputation: 2942
You should add one imageview below your desired image. and adjust alpha of that image.
Upvotes: 0
Reputation: 81848
Any reason why you don't just change the original image file? If that's not possible, you could put a white (black?) rectangle with 50% opacity below the image.
Of course there are many ways to do this but you would need to tell us more about your use case.
Upvotes: 3