美文网首页
textField实现左图右文字

textField实现左图右文字

作者: 嗯哼丶傻大个是你 | 来源:发表于2017-01-16 17:35 被阅读0次
    let imageview = UIImageView(image: UIImage(named: "contacts"))
            imageview.isUserInteractionEnabled = true
    // 手势添加,  showContactsList
            let tapGesture = UITapGestureRecognizer(target: self, action: #selector(showGesture))
            imageview.addGestureRecognizer(tapGesture)
            textfield.leftView = imageview
            textfield.leftViewMode = UITextFieldViewMode.unlessEditing
            textfield.clearButtonMode = UITextFieldViewMode.whileEditing
    
    func showGesture() {
    }
    

    相关文章

      网友评论

          本文标题:textField实现左图右文字

          本文链接:https://www.haomeiwen.com/subject/zxepbttx.html