force ScrollRect.content setup

pull/484/head
hugoymh 2024-10-16 16:21:32 +08:00
parent 0747258388
commit a074256e92
1 changed files with 5 additions and 0 deletions

View File

@ -189,6 +189,11 @@ namespace UnityEngine.UI.Extensions
_screensContainer = _scroll_rect.content; _screensContainer = _scroll_rect.content;
//ScrollRect.content RT anchors has to be stretched first in order for HSS/VSS.DistributePages() to have the correct result
_screensContainer.anchorMin = Vector2.zero;
_screensContainer.anchorMax = Vector2.one;
_screensContainer.sizeDelta = Vector2.zero;
InitialiseChildObjects(); InitialiseChildObjects();
if (NextButton) if (NextButton)