1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// GMTextField.m
// Gengmei
//
// Created by wangyang on 1/23/15.
// Copyright (c) 2015 Wanmeichuangyi. All rights reserved.
//
#import "GMTextField.h"
@implementation GMTextField
- (instancetype)initWithCoder:(NSCoder *)coder
{
self = [super initWithCoder:coder];
if (self) {
[self setup];
}
return self;
}
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self setup];
}
return self;
}
- (void)setup {
}
- (CGRect)textRectForBounds:(CGRect)bounds{
CGRect rect = [super textRectForBounds:bounds];
return UIEdgeInsetsInsetRect(rect, UIEdgeInsetsMake(3, 8, 0, 8));
}
- (CGRect)placeholderRectForBounds:(CGRect)bounds{
return [self textRectForBounds:bounds];
}
- (CGRect)editingRectForBounds:(CGRect)bounds{
return [self textRectForBounds:bounds];
}
@end