Grayed out buttons. Best approach?

Discussion in 'iPhone/iPad Programming' started by milktooth, Nov 5, 2009.

  1. macrumors member

    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?
  2. macrumors 6502

    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...
  3. macrumors 68030


    button.enabled = NO;
    is the usual way. Not sure for segmented controls though.
  4. Moderator


    Staff Member

    Have you tried using setEnabled:forSegmentAtIndex: ?
  5. macrumors member

    I have now.

    Thanks. Just the ticket.

Share This Page