Grayed out buttons. Best approach?

Discussion in 'iOS Programming' started by milktooth, Nov 5, 2009.

  1. macrumors member

    Joined:
    Oct 30, 2009
    #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

    Joined:
    Nov 30, 2005
    #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

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

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    Have you tried using setEnabled:forSegmentAtIndex: ?
     
  5. thread starter macrumors member

    Joined:
    Oct 30, 2009

Share This Page