Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nottooshabby

macrumors 6502
Original poster
Jul 12, 2008
416
90
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?
 

nottooshabby

macrumors 6502
Original poster
Jul 12, 2008
416
90
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?

Anyone?
 

Jeremy1026

macrumors 68020
Nov 3, 2007
2,215
1,029
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.
 

nottooshabby

macrumors 6502
Original poster
Jul 12, 2008
416
90
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.


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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.