Permalink
Browse files

[textfield] implement editingrectforbounds

  • Loading branch information...
1 parent eba82dc commit a2af9521007c3d8c4323ccf2c08cc0cb0b6aa461 @djMax djMax committed Feb 27, 2013
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/textfield/src/NITextField.m
View
10 src/textfield/src/NITextField.m
@@ -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)) {

0 comments on commit a2af952

Please sign in to comment.