Believe in your own future, will thank yourself right now Sinner Yun

Sinner_Yun

textfield设置左边距

 

1 CGRect frame = f;//f表示你的textField的frame
2 frame.size.width = 15;//设置左边距的大小
3 UIView *leftview = [[UIView alloc] initWithFrame:frame];
4 textField.leftViewMode = UITextFieldViewModeAlways;//设置左边距显示的时机,这个表示一直显示
5 textField.leftView = leftview;

 

posted on 2016-08-18 10:03  Sinner_Yun  阅读(412)  评论(0编辑  收藏  举报

导航