1.設置默認字體字體
[text setPlaceholder:@"inputpassword"];
2.設置邊框類型代理
[text setBorderStyle:UITextBorderStyleLine];
3.設置鍵盤類型code
[text setKeyboardType:UIKeyboardTypeAlphabet];
4.開啓鍵盤事件
[textField becomeFirstResponder];
5.關閉鍵盤input
[textField resignFirstResponder];
[self.view endEditing:YES];
4.回車代理事件string
- (BOOL)textFieldShouldReturn:(UITextField *)textField{}
5.點擊文本框代理事件it
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField{}
6.文本框內容改變的代理事件class
-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{}