您的位置:首页 > 产品设计 > UI/UE

UITextField设置placeholder颜色

2015-10-25 00:00 477 查看
方式一:
_codeTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入验证码(4位数字)" attributes:@{NSForegroundColorAttributeName:[UIColor colorWithHex:kTextLightGray]}];
方式二:KVC方式
_phoneTextField.placeholder = @"请输入手机号码";
[_phoneTextField setValue:[UIColor colorWithHex:kTextLightGray] forKeyPath:@"_placeholderLabel.textColor"];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: