diff --git a/keyBoard/Class/AiTalk/V/KBAICommentView.m b/keyBoard/Class/AiTalk/V/KBAICommentView.m index df8eb80..283dc93 100644 --- a/keyBoard/Class/AiTalk/V/KBAICommentView.m +++ b/keyBoard/Class/AiTalk/V/KBAICommentView.m @@ -91,7 +91,7 @@ static NSInteger const kRepliesLoadCount = 3; [self.inputView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.equalTo(self); make.height.mas_equalTo(50); - self.inputBottomConstraint = make.bottom.equalTo(self); + self.inputBottomConstraint = make.bottom.equalTo(self).offset(-KB_SafeAreaBottom()); }]; [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { @@ -354,17 +354,15 @@ static NSInteger const kRepliesLoadCount = 3; inSection:section]]; } - // 更新(避免动画导致跳动) - [UIView performWithoutAnimation:^{ - [self.tableView beginUpdates]; - if (insertIndexPaths.count > 0) { - [self.tableView insertRowsAtIndexPaths:insertIndexPaths - withRowAnimation:UITableViewRowAnimationNone]; - } - [self.tableView endUpdates]; - [self.tableView layoutIfNeeded]; - [self restoreHeaderAnchor:anchor]; - }]; + // 更新(带轻微动画) + [self.tableView beginUpdates]; + if (insertIndexPaths.count > 0) { + [self.tableView insertRowsAtIndexPaths:insertIndexPaths + withRowAnimation:UITableViewRowAnimationFade]; + } + [self.tableView endUpdates]; + [self.tableView layoutIfNeeded]; + [self restoreHeaderAnchor:anchor]; NSLog(@"[KBAICommentView] loadMore(after) section=%ld offsetY=%.2f contentSizeH=%.2f boundsH=%.2f rows=%ld", (long)section, @@ -411,17 +409,15 @@ static NSInteger const kRepliesLoadCount = 3; // 收起回复 [comment collapseReplies]; - // 删除行(避免动画导致跳动) - [UIView performWithoutAnimation:^{ - [self.tableView beginUpdates]; - if (deleteIndexPaths.count > 0) { - [self.tableView deleteRowsAtIndexPaths:deleteIndexPaths - withRowAnimation:UITableViewRowAnimationNone]; - } - [self.tableView endUpdates]; - [self.tableView layoutIfNeeded]; - [self restoreHeaderAnchor:anchor]; - }]; + // 删除行(带轻微动画) + [self.tableView beginUpdates]; + if (deleteIndexPaths.count > 0) { + [self.tableView deleteRowsAtIndexPaths:deleteIndexPaths + withRowAnimation:UITableViewRowAnimationFade]; + } + [self.tableView endUpdates]; + [self.tableView layoutIfNeeded]; + [self restoreHeaderAnchor:anchor]; NSLog(@"[KBAICommentView] collapse(after) section=%ld offsetY=%.2f contentSizeH=%.2f boundsH=%.2f rows=%ld", (long)section, diff --git a/keyBoard/Class/AiTalk/VC/KBAiMainVC.m b/keyBoard/Class/AiTalk/VC/KBAiMainVC.m index 071c0d0..80bbabe 100644 --- a/keyBoard/Class/AiTalk/VC/KBAiMainVC.m +++ b/keyBoard/Class/AiTalk/VC/KBAiMainVC.m @@ -240,24 +240,25 @@ #pragma mark - 事件 - (void)showComment { - CGFloat customViewHeight = KB_SCREEN_HEIGHT * (0.8); - KBAICommentView *customView = [[KBAICommentView alloc] - initWithFrame:CGRectMake(0, 0, KB_SCREEN_WIDTH, customViewHeight)]; - LSTPopView *popView = - [LSTPopView initWithCustomView:customView - parentView:self.view - popStyle:LSTPopStyleSmoothFromBottom - dismissStyle:LSTDismissStyleSmoothToBottom]; - self.popView = popView; - popView.priority = 1000; - popView.hemStyle = LSTHemStyleBottom; - popView.dragStyle = LSTDragStyleY_Positive; - popView.dragDistance = customViewHeight * 0.5; - popView.sweepStyle = LSTSweepStyleY_Positive; - popView.swipeVelocity = 1600; - popView.sweepDismissStyle = LSTSweepDismissStyleSmooth; - - [popView pop]; + CGFloat customViewHeight = KB_SCREEN_HEIGHT * (0.8); + KBAICommentView *customView = [[KBAICommentView alloc] + initWithFrame:CGRectMake(0, 0, KB_SCREEN_WIDTH, customViewHeight)]; + LSTPopView *popView = + [LSTPopView initWithCustomView:customView + parentView:nil + popStyle:LSTPopStyleSmoothFromBottom + dismissStyle:LSTDismissStyleSmoothToBottom]; + self.popView = popView; + popView.priority = 1000; + popView.isAvoidKeyboard = false; + popView.hemStyle = LSTHemStyleBottom; + popView.dragStyle = LSTDragStyleY_Positive; + popView.dragDistance = customViewHeight * 0.5; + popView.sweepStyle = LSTSweepStyleY_Positive; + popView.swipeVelocity = 1600; + popView.sweepDismissStyle = LSTSweepDismissStyleSmooth; + + [popView pop]; } - (void)showCommentDirectly {