标签:
#pragma mark - 显示超过11位不让输入
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
if (textField == _nameTextFiled) {
int maxLength = 11;
NSString * str = textField.text;
if (textField.text.length>=11) {
textField.text = [str substringToIndex:maxLength-1];
}
}
return YES;
}
标签:
原文地址:http://www.cnblogs.com/block123/p/4947658.html