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


textField.placeholder = @"username is in here";
[textField setValue:[UIColor redColr] forKeyPath:@"_placeholderLabel.textColor"];
[textField setValue:[UIFont boldSystemFontOfSize:16] forKeyPath:@"_placeholderLabel.font"];

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


你可能感兴趣的:(placeholder,textfield,KVC)