您的位置:首页 > 移动开发 > Objective-C

Objective-C更改placeholder字体颜色

2015-08-25 10:03 471 查看
法一:
self.nameTextField.placeholder =
@"Username (NOT Email Address)";
[self.nameTextField
setValue:[UIColor
whiteColor] forKeyPath:@"_placeholderLabel.textColor"];
法二:
NSAttributedString * placeholder= [[NSAttributedString
alloc] initWithString:@" Username(NOT Email Address)"
attributes:@{NSForegroundColorAttributeName: [UIColor
whiteColor]}];
self.nameTextField.attributedPlaceholder = placeholder;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  objective-c OC