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-03-18 09:54  davidyff  阅读(254)  评论(0编辑  收藏  举报