0

How to make the text input to start after some space in textfield in iPhone?

BenMorel
  • 31,815
  • 47
  • 169
  • 296
Melbourne
  • 531
  • 3
  • 24
  • 2
    You need to create a `UIView` of width say 5, and give `UITextField`'s `leftView` as that view. Explained better here - http://stackoverflow.com/a/4423805/876283 – iNoob Jun 29 '12 at 08:49
  • Do you want leading spaces in your textfield, with the cursor placed after the spaces upon selection? – Eitan Jun 29 '12 at 13:13

1 Answers1

4

try this

- (void) textFieldDidBeginEditing:(UITextField *)textField {
UIView *paddingView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 20)];
textField.leftView = paddingView;
textField.leftViewMode = UITextFieldViewModeAlways;
}

hope this help to you..

Ayaz
  • 1,398
  • 15
  • 29