改变 UITextField 提示语的 字体颜色

来源:互联网 发布:sqlserver备份语句 编辑:程序博客网 时间:2024/05/19 06:46
<pre name="code" class="objc">//第一种       UIColor *color = [UIColor whiteColor];      _userName.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"用户名" attributes:@{NSForegroundColorAttributeName: color}];      //第二种   [_userName setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];  

[textField setValue:[UIFont boldSystemFontOfSize:16] forKeyPath:@"_placeholderLabel.font"];  


                                             
0 0
原创粉丝点击