如果改变placeholder的颜色和字体大小

使用kvc的方式对placeholder的颜色和字体大小进行修改

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

你可能感兴趣的:(iOS开发,swift开发)