我找到了一个整洁的小黑客为这种确切的情况设置左边填充。基本上,您将leftView属性设置为UITextField您想要的填充大小的空视图:UIView *paddingView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 20)];textField.leftView = paddingView;textField.leftViewMode = UITextFieldViewModeAlways;对我来说就像一个魅力!在Swift 3 / Swift 4中,可以通过这样做来完成let paddingView: UIView = UIView(frame: CGRect(x: 0, y: 0, width: 5, height: 20))textField.leftView = paddingViewtextField.leftViewMode = .always