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

  

 

posted @ 2013-09-12 13:39  码匠阿杰  阅读(267)  评论(0编辑  收藏  举报