Skip to content

Instantly share code, notes, and snippets.

@sneakyness
Created April 23, 2013 20:56
Show Gist options
  • Save sneakyness/5447324 to your computer and use it in GitHub Desktop.
Save sneakyness/5447324 to your computer and use it in GitHub Desktop.
UITextField subclass alignment overrides
- (CGRect) textRectForBounds: (CGRect) bounds
{
CGRect origValue = [super textRectForBounds: bounds];
return CGRectOffset(origValue, 0.0f, 8.0f);
}
- (CGRect) editingRectForBounds: (CGRect) bounds
{
CGRect origValue = [super textRectForBounds: bounds];
return CGRectOffset(origValue, 0.0f, 8.0f);
}
- (CGRect) rightViewRectForBounds:(CGRect)bounds
{
CGRect origValue = [super rightViewRectForBounds: bounds];
return CGRectOffset(origValue, -6.0f, 0.0f);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment