美文网首页
UITextfield控件

UITextfield控件

作者: 林小姐的那片海 | 来源:发表于2017-08-18 10:03 被阅读0次

    self.userPhone=UITextField()

    1 设置左边leftview

    letu_icon =UIImageView(frame: iconFrame)

    u_icon.image=UIImage(named:"login_phone")

    self.userPhone.leftView?.backgroundColor=THEMECOLOR

    self.userPhone.leftView= u_icon

    2 设置textfield框位移

    self.userPhone.setValue(NSNumber(value:10), forKey:"paddingLeft")

    3 设置占位字符大小

    self.userPhone.setValue(UIFont.systemFont(ofSize:14), forKeyPath:"_placeholderLabel.font")

    相关文章

      网友评论

          本文标题:UITextfield控件

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