Reputation: 789
I've got a UIButton that i want to look exactly the same when it's in its disabled state as when it's in its Normal state. Right now it has a slight greyed out look to it.
Upvotes: 7
Views: 4190
Reputation: 4950
Do not use enabled property or setEnabled:NO method, instead use:
[myButton setUserInteractionEnabled:NO];
That would prevent the button for being touched, but without changing his looks!
The other way is if your button is a custom button and has an image:
[button setImage:someImage forState:UIControlStateNormal];
[button setImage:someImage forState:UIControlStateDisabled];
[button setEnabled:NO];
Upvotes: 19