#import <UIKit/UIKit.h>
@interface CYFTextField : UITextField
@end
#import "CYFTextField.h"
@implementation CYFTextField
//控制文本所在的的位置,左右缩 10
- (CGRect)textRectForBounds:(CGRect)bounds
{
return CGRectInset(bounds, 10, 0);
}
//控制编辑文本时所在的位置,左右缩 10
- (CGRect)editingRectForBounds:(CGRect)bounds
{
return CGRectInset(bounds, 10, 0);
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end