Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I Disable a button with an image without reducing the alpha in obejective C?

After creating a round rect button, i disabled the button and the alpha of the button stays at 1 unless i reduced the alpha to 0.5 manually. But after inserting an image to the button, the alpha of the button would be set to 0.5 automatically even after setting the alpha to 1 after disabling the button.

I would like to disable the button containing an image without affecting it's alpha.

Can anyone Help me?

Regards,

Bob

like image 547
DarkPP Avatar asked Jul 08 '10 03:07

DarkPP


1 Answers

Have a look at the UIButton's adjustsImageWhenDisabled property. Setting that to NO should do what you want.

There's also a similar property for highlighted buttons.

like image 101
Thomas Müller Avatar answered Sep 29 '22 21:09

Thomas Müller