{
//创建一个btn用做TextField的左侧视图View
UIButton* overlayButton = [UIButton buttonWithType:UIButtonTypeCustom];
[overlayButton setImage:[UIImage imageNamed:@"img_login_phone"] forState:UIControlStateNormal];
overlayButton.frame = CGRectMake(10, 0, 17, 30);
self.textField = [[UITextField alloc]initWithFrame:CGRectMake(10, 50, 200, 30)];
self.textField.backgroundColor = [UIColor blueColor];
//添加btn为TextField的左侧视图
self.textField.leftView = overlayButton;
self.textField.leftViewMode = UITextFieldViewModeAlways;
[self.view addSubview:self.textField];
}