1、设置paddingleft
[_inputTextField setValue:[NSNumber numberWithInt:10] forKey:@"paddingLeft"];
输入内容起始位置会右移10, 占位字符起始位置不会变.
2、通过设置一个”左视图”
CGRect frame = _inputTextField.frame;
frame.size.width = 8;// 距离左侧的距离
UIView *leftview = [[UIView alloc] initWithFrame:frame];
_inputTextField.leftViewMode = UITextFieldViewModeAlways;