From 88dd2c95e86fe305c4a8a56bbf9e8cf30b6ee5eb Mon Sep 17 00:00:00 2001 From: Ding Yuntian <1491671119@qq.com> Date: Sun, 5 Jul 2026 01:27:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E4=BF=AE=E5=A4=8D=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=BB=9A=E5=8A=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/Terminal/TerminalRecordPanel.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/UI/Terminal/TerminalRecordPanel.cs b/Assets/Scripts/UI/Terminal/TerminalRecordPanel.cs index 9ea827ab2..e928a322c 100644 --- a/Assets/Scripts/UI/Terminal/TerminalRecordPanel.cs +++ b/Assets/Scripts/UI/Terminal/TerminalRecordPanel.cs @@ -116,8 +116,9 @@ namespace AibisDream.UI private System.Collections.IEnumerator DrawRecordsWhenReady() { - yield return null; DrawRecords(); + yield return null; + ScrollToBottom(); } private void ConfigureContentRect() @@ -179,12 +180,22 @@ namespace AibisDream.UI { LayoutRebuilder.ForceRebuildLayoutImmediate(contentRect); } + } - if (scrollRect != null) + private void ScrollToBottom() + { + if (scrollRect == null) { - Canvas.ForceUpdateCanvases(); - scrollRect.verticalNormalizedPosition = 1f; + return; } + + if (recordRoot is RectTransform contentRect) + { + LayoutRebuilder.ForceRebuildLayoutImmediate(contentRect); + } + + Canvas.ForceUpdateCanvases(); + scrollRect.verticalNormalizedPosition = 0f; } private void ClearRecordItems()