user1179590
user1179590

Reputation: 65

How to enter text in a textfield by giving single space at the begining of the field?

My text field is with rounded corners. When I am entering the text the characters are touching the left border which is not looking good how can I keep a single space at the beginning of the text field.

Upvotes: 2

Views: 240

Answers (2)

vadivelu
vadivelu

Reputation: 508

Try like this:

textView.internalTextView.scrollIndicatorInsets = UIEdgeInsetsMake(1, 0, 1, 0);

Upvotes: 0

Piyush Kashyap
Piyush Kashyap

Reputation: 1965

Try this

UIView *paddingView          = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, 20)];
self.yourTextField.leftView             = paddingView;
self.yourTextField.leftViewMode         = UITextFieldViewModeAlways;

Upvotes: 1

Related Questions