Make textfield look greyed out?

Discussion in 'iOS Programming' started by nottooshabby, Sep 23, 2008.

  1. nottooshabby macrumors 6502

    Joined:
    Jul 12, 2008
    #1
    I want my textfield to look greyed out when the user flips the switch to off. I set the textfield.enable=0 when the switch is off, but that just prevents the user from editing the field, but it doesn't look greyed out. Do I need to just change the color of the field when the switch is flipped to off, or is there an automated way to make it look greyed out?
     
  2. nottooshabby thread starter macrumors 6502

    Joined:
    Jul 12, 2008
    #2
    Anyone?
     
  3. Jeremy1026 macrumors 68020

    Jeremy1026

    Joined:
    Nov 3, 2007
    #3
    Maybe put a UILabel over it with a dark grey background color and a mid to low alpha setting. Hide it when the text field is enable, and show it when it is disabled. It should give you a grayed out look, it probably isn't the best way to do it, but it would work.
     
  4. nottooshabby thread starter macrumors 6502

    Joined:
    Jul 12, 2008
    #4

    Thanks Jeremy. You gave me an idea. I just did a TextField.alpha=0.3 when the switch is turned off. That gives most of the effect I was looking for.
     

Share This Page