Is there a way to vertically align text in a UITextField
half-way between UIControlContentVerticalAlignmentCenter
and UIControlContentVerticalAlignmentBottom
or do I have to go with one of those?
You should subclass a UITextField, and override the following methods:
- (CGRect) textRectForBounds: (CGRect) bounds { CGRect origValue = [super textRectForBounds: bounds]; /* Just a sample offset */ return CGRectOffset(origValue, 0.0f, 4.0f); } - (CGRect) editingRectForBounds: (CGRect) bounds { CGRect origValue = [super textRectForBounds: bounds]; /* Just a sample offset */ return CGRectOffset(origValue, 0.0f, 4.0f); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With