您的位置:首页 > 移动开发 > IOS开发

iOS 修改textField的placeholder的字体颜色、大小

2014-10-28 16:23 507 查看
1.
textField.placeholder =
@"用户名";
[textField setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];
[textField setValue:[UIFont boldSystemFontOfSize:16] forKeyPath:@"_placeholderLabel.font"];
2.
UIColor *color = [UIColor whiteColor];
_userName.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"用户名"
attributes:@{NSForegroundColorAttributeName: color}];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: