UITextfield控件
2017-08-18 本文已影响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")