ios修改textField的placeholder的字体颜色、大小


 textField.placeholder = @"username is in here!";   

 [textField setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];

 [textField setValue:[UIFont systemFontOfSize:14] forKeyPath:@"_placeholderLabel.font"];


 这里是使用了KVC的方式,是不是很简单呢?呵呵!

你可能感兴趣的:(ios修改textField的placeholder的字体颜色、大小)