Grayed out buttons. Best approach?

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

  1. macrumors member

    #1
    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

    #2
    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

    PhoneyDeveloper

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

    dejo

    Staff Member

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

    #5
    I have now.

    Thanks. Just the ticket.
     

Share This Page