//手机号
[_nameTextField setKeyboardType:UIKeyboardTypePhonePad];
//密码
_pwdTextField.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
_pwdTextField.secureTextEntry = YES;
//实时监测输入长度
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
if (textField == _nameTextField) {
NSString *text = [textField.text stringByReplacingCharactersInRange:range withString:string];
if (text.length >= 12) {
return NO;
}
}
return YES;
}