diff --git a/QKeyboardEmotionView/Classes/QInputBarView.h b/QKeyboardEmotionView/Classes/QInputBarView.h index c8c1ce1..19ac7c5 100755 --- a/QKeyboardEmotionView/Classes/QInputBarView.h +++ b/QKeyboardEmotionView/Classes/QInputBarView.h @@ -28,6 +28,10 @@ extern const int UIInputBarViewMinHeight; // 输入框文本变化 - (void)inputBarView:(QInputBarView *)inputBarView textViewDidChange:(UITextView *)inputTextView; + +- (BOOL)inputBarView:(QInputBarView *)inputBarView textViewDidChange:(UITextView *)inputTextView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text; + + // 输入框的高度发生了改变(因为输入了值) - (void)inputBarView:(QInputBarView *)inputBarView inputTextView:(UITextView *)inputTextView heightDidChange:(CGFloat)changeValue becauseSendText:(BOOL)becauseSendText; diff --git a/QKeyboardEmotionView/Classes/QInputBarView.m b/QKeyboardEmotionView/Classes/QInputBarView.m index ee76563..5687acb 100755 --- a/QKeyboardEmotionView/Classes/QInputBarView.m +++ b/QKeyboardEmotionView/Classes/QInputBarView.m @@ -548,6 +548,10 @@ - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range r } return NO; } + + if ([self.delegate respondsToSelector: @selector(inputBarView:textViewDidChange:shouldChangeTextInRange:replacementText:)]) { + return [self.delegate inputBarView:self textViewDidChange:textView shouldChangeTextInRange:range replacementText:text]; + } return YES; }