Code Is Poetry

Life is Binary

Adding padding to uitextfield

Following code will help you to add padding to the textfield.
 
UITextField *myTextField = [[UITextField alloc]initWithFrame:CGRectMake(10, 10, 200, 35)];
myTextField.delegate = self;
myTextField.placeholder = @"Placeholder";
[myTextField setFont:[UIFont systemFontOfSize:14]];
myTextField.returnKeyType = UIReturnKeyDone;
myTextField.keyboardType = UIKeyboardTypeDefault;
UIView *paddingView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, 20)];
myTextField.leftView = paddingView;
myTextField.leftViewMode = UITextFieldViewModeAlways;
myTextField.background = [[UIImageimageNamed:@"textfield.png"] stretchableImageWithLeftCapWidth:7topCapHeight:17];
[self.view addSubview:myTextField];