easemob / easeui_ios

73 stars 62 forks source link

消息contentsize超过屏幕后,发送文字后,点击空白处,屏幕底部会有遮挡最下面的1-2条消息 #128

Closed HelloWilliam closed 3 years ago

HelloWilliam commented 3 years ago

下面2种测试都是基于内容contentsize超出一屏

1、键盘弹出,点击空白处,键盘收回,显示最后一条消息,正常!

2、键盘弹出,发送一条消息,点击空白处,键盘收回,未显示最后一条消息,显示倒数第二条或者第三条消息

是哪边约束设置的有问题吗?

HelloWilliam commented 3 years ago

已解决

- (void)keyBoardWillHide:(NSNotification *)note
{
    // 定义好动作
    void (^animation)(void) = ^void(void) {
        [self.chatBar Ease_updateConstraints:^(EaseConstraintMaker *make) {
            make.bottom.equalTo(self.view);
        }];
        [self performSelector:@selector(scrollToBottomRow) withObject:nil afterDelay:0.01];
        [self.view layoutIfNeeded];//动画变化
    };
    [self keyBoardWillHide:note animations:animation completion:^(BOOL finished) {

    }];
}

里面增加了

        [self performSelector:@selector(scrollToBottomRow) withObject:nil afterDelay:0.01];