fix(ui): 修复记录界面滚动问题

This commit is contained in:
2026-07-05 01:27:08 +08:00
parent f87dcc687f
commit 88dd2c95e8
@@ -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()