//第一种 修改属性attribute
UIColor *color = [UIColorwhiteColor];
UITextField* _userName = [UITextFieldnew];
_userName.attributedPlaceholder = [[NSAttributedStringalloc]initWithString:@"用户名"attributes:@{NSForegroundColorAttributeName: color}];
//第二种 KVC
[_userName setValue:[UIColorwhiteColor]forKeyPath:@"_placeholderLabel.textColor"];