ios13 UITextField 设置leftView不响应不生效的问题

2020-01-08 10:14:01 浏览数 (1)

代码语言: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;

0 人点赞