Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
wenbobao committed Sep 6, 2016
2 parents 3608e6e + b13b049 commit 580c7c3
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions ZYChat-EaseMob/ZYChat/GJGCChatInputPanel/GJGCChatInputTextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,15 @@ - (void)expandTextViewToHeight:(CGFloat)height

_inputTextStateHeight = self.gjcf_height;

[UIView commitAnimations];

/* 文本视图 */
self.textView.frame = CGRectMake(2, 2, self.gjcf_width - 4, self.gjcf_height - 4);

if (self.gjcf_height == self.maxAutoExpandHeight) {
[self layoutInputTextView];
}

[UIView commitAnimations];

}

- (void)layoutInputTextView
Expand All @@ -360,9 +364,12 @@ - (void)updateDisplayByInputContentTextChange

if (contentSize.height - 8.f > self.textView.bounds.size.height && self.frame.size.height <= self.maxAutoExpandHeight) {

CGFloat changeDelta = contentSize.height - 8.f - self.frame.size.height;
//黏贴场文本的时候会出现错误情况,控制一下
CGFloat minExpand = MIN((contentSize.height - 8.f), self.maxAutoExpandHeight);

[self expandTextViewToHeight:contentSize.height - 8.f];
CGFloat changeDelta = minExpand - self.frame.size.height;

[self expandTextViewToHeight:minExpand];

if (self.frameChangeBlock) {
self.frameChangeBlock(self,changeDelta);
Expand Down

0 comments on commit 580c7c3

Please sign in to comment.