Fixing menu building issues.

Hey Everyone,

So i ran into this UI. It is a very complex one, so i will try to describe it. with the following illustration and text:

We have a screen space canvas(black lines), it has a horizontal scroll view.(Blue lines)
In this scroll views content there are 5 elements side by side (Red)(that we use as pages with some custom script)
Each of these elements has a Vertical scroll view.(Orange)
In this vertical one we have child with a vertical layout group (to space out all the elements in there) And a content size fitter (To make this element size with whatever content is in there, set to preferred size)
Children to this vertical layout group, are blocks of “content” whatever may be in those.(Black boxes) Each with their own unique content.
The amount of blocks are variable, the content and size of those blocks is also variable, the blocks can be expanded/retracted, it is all around fun for the whole family in there.

Here comes the issue.
For clarity sake, we wanted all those blocks and it’s content in a logical hierarchy way (with an EMPTY parent to hold all the blocks children etc.)
But the moment we actually implement it that way, we for some reason lose a lot of ways to set it’s size variably. We usually have content size fitter for this, but we are in a layout group so this starts throwing warnings that to what i read are defined as: “If you do this, you get undefined behavior.”

Since all of the content in this parent is variable, but the object itself has no actual size (Nothing like an image or so), nor the automatic way of resizing. How would i be able to make this work?

I was looking into something to somehow write my own code upon layout recalculation (Which i did not find so far) In order to maybe have it index all it’s children’s sizes to determine it’s own width and height in order to recalculate properly as the UI explained.

Somehow someone in the office had it all working, but this involved recalculating canvas elements over and over by some wicked double for loop to call some “redraw immediate” methods. But this causes any recalculation to take 1.5s on any mobile device. It isn’t pretty. This also breaks entirely when upgraded to 2017.2

If you have any idea, please advice!

Nobody has this issue?