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







