您能帮我解决这个错误吗?我尝试向UITextFeild添加图标,它显示如下错误:
无法在(UITextField)上设置(fieldImage)用户定义的检查属性
这是我的代码:
var errorImg = UIImageView(frame: CGRect(x: 0, y: 0, width: 30,height: 30))
errorImg.image = UIImage(named: "error")
errorImg.contentMode = UIViewContentMode.right
txtEmail.rightViewMode = .always
txtEmail.rightView = errorImg
txtPhone.rightViewMode = .always
txtPhone.rightView = errorImg
请帮助。谢谢。