【修改 UITextField 中 placeholder 的顏色】
第一种方法:
[textfeild setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];
第二种方法:
@interface LBTextField : UITextField @end
@implementation LBTextField
- (void)drawPlaceholderInRect:(CGRect)rect{
[[UIColor orangeColor] setFill];
[[self placeholder] drawInRect:rect withFont:[self font]];
}
@end

浙公网安备 33010602011771号