Tuesday, 19 November 2013

Change UITextField’s placeholder color without subclassing it


Change UITextField’s placeholder color without subclassing it

The safe way to customize UITextField’s placeholder is subclassing theUITextField and overriding placeholderRectForBounds:, Apple won’t bother you on this one. However, if you want to take the risk, you can try this way:

[self.MyTextField  setValue: [UIColor darkGrayColor]  
                                 forKeyPath: @"_placeholderLabel.textColor"];

Thanks 
R.Anusha

No comments:

Post a Comment