- Home /
Question by
Justinger · Jun 22, 2018 at 06:15 AM ·
canvasrecttransformscrollbar
UI Scrollbar in the wrong location
I've made some scripts that allow me to move and resize windows, very similar to folders on a PC. However, if I move and/or resize the window and then enable some hidden UI elements they do not update from their old position. This fixes when I move or scale the window again...
I've tried a number of things to no avail. I've used LayoutRebuilder.ForceRebuildLayoutImmediate, Canvas.ForceUpdateCanvases, as well as setting new positions, or even invoking these with a delay.
I imagine I am missing/misusing some kind of canvas update to ensure that all of the children's rectTransforms are in the right spots. Does anyone have any idea what to do? I have attached a small unity package with my code and example scene if that helps.
Thanks!
scrollbar-questionjg1.zip
(11.1 kB)
foldout-problem-explanation1.gif
(87.1 kB)
Comment