How do you automatically fit a child of a layout group to the parent without it adjusting to fit its own contents?

I’m trying to make sure that the game that I’m working on will work on different resolutions, but I’m having considerable trouble with the children of layout groups. For example, I have an RPG-style text/dialogue box that fits across the screen - the main object has a Horizontal Layout Group element so that its children (two images for character portraits and one text element in the middle) can adjust themselves if one of the elements isn’t present (because I usually only need one portrait and sometimes none at all). That part works fine. The problem is that, while I can set the anchor points for the parent object so that it correctly resizes itself based on the screen resolution, I can’t do the same for the children, so, if the aspect ratio is anything less than 16:9, the images and text breach the sides of the box and go off of the screen. Further complicating that is that I’ve written a script to display text one character at a time, using PreferredHeight to check if the next word should wrap to the next line; if I check “Child Controls Size” to correct the previous issue, the size of the text element immediately shrinks to the size of the first word in the string and then goes off of the bottom of the text element. There are some screenshots of what I mean in the following links, because I need a few to explain what I mean and I can only embed two images into the post:


This is how it looks correctly at 16:9.


This is the Game window at 5:4 without “Child Controls Size” checked (it looks the same whether or not a preview is running).


This is the Game window at 5:4 with “Child Controls Size” checked, but also without a game preview running, so the text is just displayed all at once.


This is the Game window at 5:4 with “Child Controls Size” checked, during a game preview, where it all goes horribly wrong.


Am I missing something about how resizing and layout groups work? Is there a way to handle this using layout elements and the settings that I already have, or am I going to have to figure out how to do it via script? I have no idea where to even start with that, so any help will be hugely appreciated, on any front. Thank you.

Looks like I fixed it! Turns out that a combination of Child Controls Size and Child Force Expand is what I wanted after all.