Unity Scroll View inside a Vertical Layout Component not accounting for Content size

45 views Asked by At

I'm trying to achieve this UI behavior with Unity (see screenshot). Essentially, "Window" should be as small as its content, but, if its content overflows the screen, then the scroll view does its job.

enter image description here

The problem I'm encountering is that, no matter how many buttons I add in the Content, the Window does not resize, the Scroll View always has a dynamic height of 0. I can get the desired behavior by adding images or text, but it just won't take into account the content of the Scroll View.

I tried a million combinations of adding Layout Elements, Content Size Fitters, Vertical Layout Groups... But I cannot figure out the correct combination for the life of me.

This is what my hierarchy looks like:

enter image description here

Help, please!

0

There are 0 answers