首页 > 其他 > 详细

UITextField设置placeholder颜色

时间:2015-09-24 17:48:53      阅读:221      评论:0      收藏:0      [点我收藏+]

方式一:

_codeTextField.attributedPlaceholder = [[NSAttributedString allocinitWithString:@"请输入验证码(4位数字)" attributes:@{NSForegroundColorAttributeName:[UIColor colorWithHex:kTextLightGray]}];

方式二:KVC方式

_phoneTextField.placeholder = @"请输入手机号码";

 [_phoneTextField setValue:[UIColor colorWithHex:kTextLightGrayforKeyPath:@"_placeholderLabel.textColor"];


UITextField设置placeholder颜色

原文:http://my.oschina.net/u/2473136/blog/510776

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!