改变textfield中placeholder字体大小和颜色的方法

写项目偶遇改变textfield的placeholer字体颜色和大小,不想自定义textfield就搜了一下,感觉这个方法很实用,就随手记下了
self.textField.placeholder=@"请输入支付密码";
//改变颜色
[self.textField setValue:[UIColor grayColor] forKeyPath:@"_placeholderLabel.textColor"];
//改变字体大小
[self.textField setValue:[UIFont boldSystemFontOfSize:13] forKeyPath:@"_placeholderLabel.font"];

欢迎一起交流iOS群436337987

原文地址:https://www.cnblogs.com/shao621/p/5234846.html