View Full Version : Grayed out buttons. Best approach?

Nov 5, 2009, 05:48 AM
How do you gray-out buttons, particularly segmented controls?

I've tried setting alpha to .5, but with segmented controls the left and right parts overlap leaving an opaque strip in the center. Is there a preferred approach?

Thomas Harte
Nov 5, 2009, 05:59 AM
The best I've come up with is putting a half-transparent quad on top with the same colour/texture as the background on which the controls appear. It's fiddly though, so I'd say recommended only if someone doesn't have a better idea...

Nov 5, 2009, 08:28 AM
button.enabled = NO;

is the usual way. Not sure for segmented controls though.

Nov 5, 2009, 09:37 AM
Have you tried using setEnabled:forSegmentAtIndex: ?

Nov 5, 2009, 10:11 AM
I have now.

Thanks. Just the ticket.