-(void)textViewDidChange:(UITextView *)textView{
//博客园-FlyElephant
static CGFloat maxHeight = 95;
CGRect frame = textView.frame;
CGSize constraintSize = CGSizeMake(frame.size.width, MAXFLOAT);
CGSize size = [textView sizeThatFits:constraintSize];
if (size.height<=maxHeight) {
size.height=maxHeight;
}
textView.scrollEnabled = NO; // 不允许滚动
textView.frame = CGRectMake(frame.origin.x, frame.origin.y, frame.size.width, size.height);
//博客园-FlyElephant
static CGFloat maxHeight = 95;
CGRect frame = textView.frame;
CGSize constraintSize = CGSizeMake(frame.size.width, MAXFLOAT);
CGSize size = [textView sizeThatFits:constraintSize];
if (size.height<=maxHeight) {
size.height=maxHeight;
}
textView.scrollEnabled = NO; // 不允许滚动
textView.frame = CGRectMake(frame.origin.x, frame.origin.y, frame.size.width, size.height);
}