헤더
@interface UITextField (Padding) {
}//end Variables
-(void) setLeftPadding:(int) paddingValue;
-(void) setRightPadding:(int) paddingValue;
@end
구현 부
@implementation UITextField (Padding)
-(void) setLeftPadding:(int) paddingValue {
UIView *paddingView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, paddingValue, self.frame.size.height)];
self.leftView = paddingView;
self.leftViewMode = UITextFieldViewModeAlways;
}//end setLeftPadding Method
-(void) setRightPadding:(int) paddingValue {
UIView *paddingView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, paddingValue, self.frame.size.height)];
self.rightView = paddingView;
self.rightViewMode = UITextFieldViewModeAlways;
}//end setRightPadding Method
@end
'Development > IOS & Mac' 카테고리의 다른 글
[IOS Library] UltraVisual 스타일 CollectionView (0) | 2014.05.15 |
---|---|
[iOS] Array Sorting (0) | 2014.05.14 |
[IOS Library] 이미지 Blur 처리해주는 라이브러리 (0) | 2014.05.13 |
[IOS Library] 이미지에서 색상값 추출 (0) | 2014.05.12 |
[iOS] capturing self strongly in this block is likely to lead to a retain cycle (0) | 2014.04.07 |