fix(ui): 修复记录界面滚动问题
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user