I have a UIButton (set to input "Custom"). If I set the image in Interface Builder, the image will be displayed correctly, with transparency. But if I try to install it programmatically while the application is running (for example, to change the image displayed on the button), the transparency does not display correctly - instead, I get a white background for the image.
This is how I set the button image in the code:
[die1Button setImage:[UIImage imageNamed:die1.dieImage] forState:UIControlStateNormal];
It would be extremely grateful for any ideas.
source share