-(void)textViewDidChange:(UITextView*)textView{
floattextViewHeight = [textViewsizeThatFits:CGSizeMake(textView.frame.size.width,MAXFLOAT)].height;
if(_Lastheight==0) {
_Lastheight= textViewHeight;
return;
}
CGRectframe = textView.frame;
frame.size.height= textViewHeight;
CGFloatoffY = textViewHeight -_Lastheight;
frame.origin.y-=offY;
_Lastheight= textViewHeight;
textView.frame= frame;
}
-(BOOL)textViewShouldBeginEditing:(UITextView*)textView{
IQKeyboardManager *manager = [IQKeyboardManager sharedManager];
[managersetKeyboardDistanceFromTextField:10];
return YES;
}
-(BOOL)textViewShouldEndEditing:(UITextView*)textView{
IQKeyboardManager *manager = [IQKeyboardManager sharedManager];
[managersetKeyboardDistanceFromTextField:20];
return YES;
}
网友评论