user5513630
user5513630

Reputation: 1699

How to set the text field letter slightly right side

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

Upvotes: 0

Views: 138

Answers (2)

Chandu
Chandu

Reputation: 82

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.

Upvotes: 0

Gürhan KODALAK
Gürhan KODALAK

Reputation: 580

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?

Upvotes: 1

Related Questions