0

I have two text fields, for username and password. I created designs for both uitextfield using the layer property.

When enter some text, values are displayed starting from the edge like below:

bad layout

Is there any possible to move that username slightly to the right as a starting point for uitextfield?

Thanks

Community
  • 1
  • 1
user5513630
  • 1,617
  • 6
  • 19
  • 40

2 Answers2

1

UITextField Class Reference, this class has a overlay views inside it like leftView and rightView so just create a blank view and add it to your textField's leftView.

Also you can check these. UITextfield leftView/rightView padding on iOS7

Text inset for UITextField?

Community
  • 1
  • 1
Gürhan KODALAK
  • 549
  • 7
  • 20
0
UIView *paddingView_textFieldFullName = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 35)];
yourTextFieldName.leftView = paddingView_textFieldFullName;
yourTextFieldName.leftViewMode = UITextFieldViewModeAlways;
yourTextFieldName.text = @"";
yourTextFieldName.delegate=self;

try this code, I hope helps to you.

Chandu
  • 82
  • 5