3

Now i am using the private method which is given below,

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

Please any help for the public method for the changing the Placeholder color.

Thanks in Advance.

taskinoor
  • 45,586
  • 12
  • 116
  • 142
Dhaya
  • 41
  • 1
  • 5
  • possible duplicate of http://stackoverflow.com/questions/1340224/iphone-uitextfield-change-placeholder-text-color – RK- May 09 '11 at 06:50

1 Answers1

2

Try:

(void) drawPlaceholderInRect:(CGRect)rect {
    [[UIColor blueColor] setFill];
    [[self placeholder] drawInRect:rect withFont:[UIFont systemFontOfSize:16]];
}
Joe McBride
  • 3,789
  • 2
  • 34
  • 38
  • - Thanks....But from my point the easy way to change placeholder font color is In NIB files place label over the Textfield.. Make color of the text in NIB files itself... In (BOOL)textFieldShouldBeginEditing make label hidden YES and In (BOOL)textFieldShouldReturn & (BOOL)textFieldShouldEndReturn make Label Hidden NO.... – Dhaya May 11 '11 at 12:32