textField设置placeholder的字体大小,颜色等

textField.placeholder = @"请输入密码";
[textField setValue:[UIColor redColr] forKeyPath:@"_placeholderLabel.textColor"];
[textField setValue:[UIFont boldSystemFontOfSize:16] forKeyPath:@"_placeholderLabel.font"];

setValue: forKeyPath:    利用kvc的机制,设置placeholder的属性

猜你喜欢

转载自blog.csdn.net/chermon_love15/article/details/50669533
今日推荐