联合IQKeyboard控制回复栏高度

-(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;

}

你可能感兴趣的:(联合IQKeyboard控制回复栏高度)