-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPDPaddingTextField.m
More file actions
43 lines (36 loc) · 823 Bytes
/
PDPaddingTextField.m
File metadata and controls
43 lines (36 loc) · 823 Bytes
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
//
// PDPaddingLabel.m
// Eigooo
//
// Created by Peter on 14/10/13.
//
//
#import "PDPaddingTextField.h"
@implementation PDPaddingTextField
@synthesize leftPadding;
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}
- (CGRect)textRectForBounds:(CGRect)bounds
{
return CGRectMake(bounds.origin.x + self.leftPadding, bounds.origin.y,
bounds.size.width - self.leftPadding, bounds.size.height);
}
- (CGRect)editingRectForBounds:(CGRect)bounds
{
return [self textRectForBounds:bounds];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
// Drawing code
}
*/
@end