I am trying to put together what I thought would be a simple layout. 4 strings in a horizontal line. The first 3 should adjust to the size they need based on their text and never get smaller than that.
The last string (area if you like) will take whatever is left after the other three take what they need but can expand vertically all it wants to fit the string. Here is what it looks like with a short last string:

So far so good.
The parent component has a Horizontal Layout Group with “Child Force Expand” off for width and on for height. Then a Content Size Fitter with Vertical fit set to Prefered Size and Horizontal Fit to Unconstrained.
The first 3 text fields have a Content Size Fitter set to Horizontal Preferred Size. And the last text has nothing.
The problem is that I don’t seem to find a way to restrict the 3 first strings from getting smaller than their prefer size (note, that the strings will change so setting the min value to a constant is not possible). So here is what happens when the last string gets longer:

It wraps vertically great but it squeezes the other strings ! 
Does anyone have any clues as to how I can get to my goal?
Please Remember that the other strings can change so I cannot assign any hard values. This is all dynamic.
Thanks
1 Like
Try this:
-
Panel: Horizontal Layout Group (only Control Child Size > Width ticked), Content Size Fitter (Vertical: Preferred)
-
Text [00000]
-
Text [00:00:00]
-
Text [Author]
-
Panel: Layout Element (Flexible Width ticked)
-
Text “Your long or short string here.” (RectTransform fill entire parent [blue arrows vert & horiz])
EDIT: Sorry, scratch that. It doesn’t auto-adjust the height of the parent panel. Just take it as an example that you’re not the only one who struggles with Unity UI’s frustrating auto layout. My thinking was that you’d create a container panel for your long text. This container panel is allowed to take up any remaining space in the top-level Horizontal Layout Group. The text inside the container panel is constrained to the width of the container panel. I’d have to take another really careful read through the Auto Layout page to figure out how to get the container panel to expand height-wise only to the height of the child text.
Frustrating. I have not found a solution yet. I even tried with two strings. One is to remain static (but with dynamic text) the other can use up the rest of the space remaining ! . Nothing. The seconds string keep slowly squeezing the first string down. I am out of ideas. Except to try to set the min width of a layout element component for the first string, after the dynamic text gets set. That will work, but I can’t figure out how to get the width of a TextMeshProUGUI component !
…I am dying…