修改UITextfield的Placeholder字体的颜色

//第一种

UIColor *color = [UIColor whiteColor];  

userName.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"用户名" attributes:@{NSForegroundColorAttributeName: color}];  

//第二种   

[_userName setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];  

posted @ 2015-10-15 11:34  kevin丶涛  阅读(98)  评论(0编辑  收藏  举报