//监听字数变化

- (IBAction)editingChange:(UITextField *)textField

{

 

    NSString *nickName;

    switch (textField.tag) {

        case 10:

        {

            if (textField.markedTextRange) {

                break;

            }

            nickName = [textField.textstringByTrimmingCharactersInSet:[NSCharacterSetwhitespaceAndNewlineCharacterSet]];

            if (nickName.length > 5) {

                textField.text = [nickName substringToIndex:5];

 

            }

            break;

        }

           

        default:

            break;

    }

}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-14
  • 2022-12-23
  • 2021-11-22
  • 2021-07-16
相关资源
相似解决方案