I have subclass the UITextField class and did the below code
- (void)drawPlaceholderInRect:(CGRect)rect
{
[self.placeHolderTextColor setFill];
[self.pl
A slight update
- (void) drawPlaceholderInRect:(CGRect)rect {
if (self.useSmallPlaceholder) {
NSDictionary *attributes = @{
NSForegroundColorAttributeName : kInputPlaceholderTextColor,
NSFontAttributeName : [UIFont fontWithName:kInputPlaceholderFontName size:kInputPlaceholderFontSize]
};
//center vertically
CGSize textSize = [self.placeholder sizeWithAttributes:attributes];
CGFloat hdif = rect.size.height - textSize.height;
hdif = MAX(0, hdif);
rect.origin.y += ceil(hdif/2.0);
[[self placeholder] drawInRect:rect withAttributes:attributes];
}
else {
[super drawPlaceholderInRect:rect];
}
}
http://www.veltema.jp/2014/09/15/Changing-UITextField-placeholder-font-and-color/