Padding in UITextField

2019-02-24 12:39发布

问题:

Is it possible to set padding inside a UITextField, if so how?

回答1:

I was also wondering, here you are:

UIView paddingView = new UIView(new CGRect(0, 0, 5, 20));
YourTextField.LeftView = paddingView;
YourTextField.LeftViewMode = UITextFieldViewMode.Always;

You can modify padding size of course by changing values above.

Hope this will help.



标签: xamarin.ios