//设置leftView,可使文字向右偏移textField.leftView=UIView.init(frame:CGRectMake(0,0,5,0))textField.leftViewMode= .Always;