UITextView

  • (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText: (NSString *)text
    {
    if([text isEqualToString:@"\n"]){

      [textView resignFirstResponder];
      
      return NO;
    

    }
    if (range.location>100)
    {

      return  NO;
    

    }
    else
    {
    return YES;
    }
    }

你可能感兴趣的:(UITextView)