代码语言:javascript复制
UIView *phoneView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 18, _phoneTextField.height)];
UIImageView *phoneImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"login_phone"]];
phoneImage.frame = CGRectMake(0, 10, 18, 23);
[phoneView addSubview:phoneImage];
self.phoneLeftView = phoneImage;
_phoneTextField.leftView = phoneView;
_phoneTextField.leftViewMode = UITextFieldViewModeAlways;