I have subclassed UITextfield to allow background image, placeholder text color. It is working as expected in iPad. But on iPhone, it keeps on highlighting blue color and no text entry can be seen. The screenshot can be seen here
The code for subclass is as follows:
- (CGRect) textRectForBounds:(CGRect)bounds {
return CGRectInset(bounds, 10, 10);
}
- (CGRect) editingRectForBounds:(CGRect)bounds {
return CGRectInset(bounds, 10, 10);
}
- (void) drawPlaceholderInRect:(CGRect)rect {
[[UIColor colorWithRed:.533 green:.553 blue:.220 alpha:1.0] setFill];
[[self placeholder] drawInRect:rect withFont:self.font lineBreakMode:NSLineBreakByTruncatingTail alignment:NSTextAlignmentLeft];
}
It works perfectly on iPad. And this is both on simulator and device. Can anyone shed some light on this.