ios13 UITextField 设置leftView不响应不生效的问题
- 2020 年 1 月 8 日
- 筆記
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;