Problem with dynamic height elements inside Vertical Layout Group
I have a Vertical Layout Group that I want to populate with an array of elements. The element consists of:
Text A: stretch all, X: 0 - 0.7
Text B: stretch all, X: 0.7 - 1
Image A: horizontal separator line. Anchored to Y 0
The problem: Both Text A or Text B can span multiple lines. I want the element (e.g. the parent of the 3 elements above) to have the minimum height required to accommodate the bigger of the text elements (shown to the right; the second element is longer than the others).
The usual "Content Size Fitter + Hor/Vert Layout Group on Parent" trick doesn't work, since it overrides the stretch all anchoring of the 2 text elements, thus leading to inconsistent layout inside the list.
I tried several other approaches using Content Size Fitters, Layout Elements and Layout Groups, but couldn't get a satisfying result.
Would be glad if anyone has found a solution for this or similar situations.
I would also like to know this. I want my elements to be able to scale dynamically during runtime, for instance an element in the middle of the list would then expand as the full message is read pushing everything below it down. Can't get it to work.
Your answer
Follow this Question
Related Questions
Layout Group with Content Fitter? 0 Answers
How to make a Layout Groups child fit its content. 0 Answers
UI Nested Vertical Layout Groups 0 Answers
Is there anyway to make an input field stretch to fit a body of text? 0 Answers
Layout groups don't work 1 Answer