第一种方法:(KVO)
textField.placeholder = @"XXX";
[textField setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];
注意这两句的顺序不能颠倒
第二种方法:(重写UITextField的drawPlaceholderInRect方法)
- (void)drawPlaceholderInRect:(CGRect)rect {
[[UIColor redColor] setFill];
[[self placeholder] drawInRect:rect withFont:[UIFont systemFontOfSize:16]];
}