CGRect frame = f;//f表示你的textField的frame
frame.size.width = ;//设置左边距的大小
UIView *leftview = [[UIView alloc] initWithFrame:frame];
textField.leftViewMode = UITextFieldViewModeAlways;//设置左边距显示的时机,这个表示一直显示
textField.leftView = leftview;
2024-04-11 17:31:43
CGRect frame = f;//f表示你的textField的frame
frame.size.width = ;//设置左边距的大小
UIView *leftview = [[UIView alloc] initWithFrame:frame];
textField.leftViewMode = UITextFieldViewModeAlways;//设置左边距显示的时机,这个表示一直显示
textField.leftView = leftview;