陈斌彬的技术博客

Stay foolish,stay hungry

怎么改变uitextfield Placeholder的颜色和位置?

继承UITextfield,重写这个方法:

- (void) drawPlaceholderInRect:(CGRect)rect { 
[[UIColor blueColor] setFill]; 
[self.placeholder drawInRect:rect withFont:self.font lineBreakMode:UILineBreakModeTailTruncation alignment:self.textAlignment]; 
}