I have a custom font in a UITextField, and I\'ve noticed that when it\'s accessed (when the keyboard appears), the text shifts down by a very small amount -- maybe
My solution is along the same lines a McDJ's, but with a slightly different twist. Subclass UITextField and override only these:
- (CGRect)placeholderRectForBounds:(CGRect)bounds {
return CGRectOffset( [self editingRectForBounds:bounds], 0, 2 );
}
- (CGRect)editingRectForBounds:(CGRect)bounds {
return CGRectOffset( [super editingRectForBounds:bounds], 0, -2 );
}
With the custom font I'm using, 2 points is the correct vertical adjustment, helping placeholder, "static", and "editing" text all stay on the same vertical line.