From 0fa31418f601dfe7f3a3ded59132e774047b182d Mon Sep 17 00:00:00 2001 From: CodeST <694468528@qq.com> Date: Mon, 26 Jan 2026 13:51:38 +0800 Subject: [PATCH] 1 --- keyBoard/Class/AiTalk/V/KBChatTableView.m | 11 ++++++++--- keyBoard/Class/AiTalk/VC/KBAiMainVC.m | 4 ++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/keyBoard/Class/AiTalk/V/KBChatTableView.m b/keyBoard/Class/AiTalk/V/KBChatTableView.m index 552330b..f5c4eb4 100644 --- a/keyBoard/Class/AiTalk/V/KBChatTableView.m +++ b/keyBoard/Class/AiTalk/V/KBChatTableView.m @@ -546,10 +546,12 @@ static const NSTimeInterval kTimestampInterval = 5 * 60; // 5 分钟 self.playingCellIndexPath = indexPath; - // 更新 Cell 状态 + // 更新 Cell 状态,禁用动画避免 TableView 跳动 KBChatAssistantMessageCell *cell = [self.tableView cellForRowAtIndexPath:indexPath]; if ([cell isKindOfClass:[KBChatAssistantMessageCell class]]) { - [cell updateVoicePlayingState:YES]; + [UIView performWithoutAnimation:^{ + [cell updateVoicePlayingState:YES]; + }]; } } @@ -561,7 +563,10 @@ static const NSTimeInterval kTimestampInterval = 5 * 60; // 5 分钟 if (self.playingCellIndexPath) { KBChatAssistantMessageCell *cell = [self.tableView cellForRowAtIndexPath:self.playingCellIndexPath]; if ([cell isKindOfClass:[KBChatAssistantMessageCell class]]) { - [cell updateVoicePlayingState:NO]; + // 禁用动画,避免 TableView 跳动 + [UIView performWithoutAnimation:^{ + [cell updateVoicePlayingState:NO]; + }]; } self.playingCellIndexPath = nil; } diff --git a/keyBoard/Class/AiTalk/VC/KBAiMainVC.m b/keyBoard/Class/AiTalk/VC/KBAiMainVC.m index c6f257c..77d39b9 100644 --- a/keyBoard/Class/AiTalk/VC/KBAiMainVC.m +++ b/keyBoard/Class/AiTalk/VC/KBAiMainVC.m @@ -200,12 +200,16 @@ make.top.equalTo(self.view.mas_safeAreaLayoutGuideTop).offset(8); make.left.equalTo(self.view).offset(16); make.right.equalTo(self.view).offset(-16); + // 设置固定高度,避免内容变化导致布局跳动 + make.height.mas_equalTo(20); // 单行文本高度 }]; [self.transcriptLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.statusLabel.mas_bottom).offset(8); make.left.equalTo(self.view).offset(16); make.right.equalTo(self.view).offset(-16); + // 设置固定高度,避免内容变化导致布局跳动 + make.height.mas_equalTo(60); // 根据实际需要调整高度 }]; // 设置内容压缩阻力,避免被压缩 [self.transcriptLabel setContentCompressionResistancePriority:UILayoutPriorityDefaultLow