I'm trying to use a custom textfield background. The problem is that the text then appears to be too close on the left.
I don't see any way to shift the text without subclassing UITextField. So I'm attempting to extend and overwrite
- (void)drawTextInRect:(CGRect)rect{
NSLog(@"draw rect");
CGRect newRect = CGRectMake(rect.origin.x+20,rect.origin.y,rect.size.width-20,rect.size.height);
[super drawTextInRect:newRect];
}
But for some reason the log never prints. I know the subclass is being used since I also have a log in the init, and that prints fine.
Whast goig on
EDIT.
I also try
- (CGRect)textRectForBounds:(CGRect)bounds{
NSLog(@"bounds");
CGRect b = [super textRectForBounds:bounds];
b.origin.x += 20;
return b;
}
That actually traces, but it doesn't seem to be shifting