Hello,
I got quite complicated question and don’t know how to make the structure correctly.
So, I got an UI elements container with VerticalLayoutGroup (ChildForceExpand - width). The container got flexible width and it size calculated by anchors depending on Screen.width. Also GO got ContentSizeFitter (vertical - min size) because it is controlled by VerticalScrollBar and viewport mask. The structure is similar to this example:
http://docs.unity3d.com/Manual/script-ScrollRect.html
Inside that container I got many UI elements and I want they would be stretched to container width, and their height must be controlled by AspectRatioFitter (width controls height).
So, here is a problem - on instantiating ContentSizeFitter running before each UI element inside container calculates their height depending on the possible width stretching. How you understand, I cant set the MinHeight in LayoutElement BEFORE the AspectRatioFitter sets it.
I can’t understand, how I can setup the MinHeight after correct height is calculated? Is there a way to do it in inspector? If not, how can I do it by script?
Thanks,