Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[textfield] implement editingrectforbounds

  • Loading branch information...
commit a2af9521007c3d8c4323ccf2c08cc0cb0b6aa461 1 parent eba82dc
Max Metral authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/textfield/src/NITextField.m
10 src/textfield/src/NITextField.m
View
@@ -32,6 +32,16 @@ -(void)drawPlaceholderInRect:(CGRect)rect
}
}
+-(CGRect)editingRectForBounds:(CGRect)bounds
+{
+ if (UIEdgeInsetsEqualToEdgeInsets(UIEdgeInsetsZero, self.textInsets)) {
+ return [super editingRectForBounds:bounds];
+ }
+ UIEdgeInsets i = self.textInsets;
+ return CGRectMake(bounds.origin.x + i.left, bounds.origin.y + i.top,
+ bounds.size.width - i.left - i.right, bounds.size.height - i.top - i.bottom);
+}
+
-(CGRect)textRectForBounds:(CGRect)bounds
{
if (UIEdgeInsetsEqualToEdgeInsets(UIEdgeInsetsZero, self.textInsets)) {
Please sign in to comment.
Something went wrong with that request. Please try again.