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

textField.placeholder = @"username is in here!";  
[textField setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];  
[textField setValue:[UIFont boldSystemFontOfSize:16] forKeyPath:@"_placeholderLabel.font"]; 

这里是使用了KVC的方式,是不是很简单.

posted @ 2016-07-16 11:52  ma_fighting  阅读(6428)  评论(2)    收藏  举报
历史天气查