先记录一点新知识
UITextField 如何修改placeholder属性?
[desTextField setValue:[UIColor redColor] forKeyPath:@"placeholderLabel.textColor"];
[desTextField setValue:[UIFont systemFontOfSize:14] forKeyPath:@"placeholderLabel.font"];
textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"密码" attributes:@{NSForegroundColorAttributeName: color}];
本文介绍了如何使用UITextField自定义其占位符的颜色和字体大小,通过设置textField的attributedPlaceholder属性来实现更加灵活的样式调整。
1030

被折叠的 条评论
为什么被折叠?



