方式一:spa
_codeTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入验证码(4位数字)" attributes:@{NSForegroundColorAttributeName:[UIColor colorWithHex:kTextLightGray]}];code
方式二:KVC方式orm
_phoneTextField.placeholder = @"请输入手机号码";ci
[_phoneTextField setValue:[UIColor colorWithHex:kTextLightGray] forKeyPath:@"_placeholderLabel.textColor"];it