【修改 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

  

原文地址:https://www.cnblogs.com/Ionatan/p/3316723.html