I am trying to use my own text box background. The problem is that the text seems too close on the left.
I see no way to shift text without subclassing UITextField. Therefore, I am trying to expand and rewrite
- (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 magazine never prints. I know that a subclass is being used, since I also have a log in init, and this prints fine.
Extremely dangerous
EDIT.
I also try
- (CGRect)textRectForBounds:(CGRect)bounds{
NSLog(@"bounds");
CGRect b = [super textRectForBounds:bounds];
b.origin.x += 20;
return b;
}
It really tracks, but it doesn't seem to be biasing
source
share