How to change the height of a Panel?

I have a Panel with a Vertical Layout Group assigned, and I would only like it to change the height based on the amount of content with, not stretch. How do I do that?

Thanks.

Here is an example. I would like to have a fixed height for each of the Panels that have the text/slider. Right now it seems to stretch the height of the Background panel.

2339147--158147--ss.png

You can give each child that exists in the Vertical Layout Group its own Layout Element and give a specific preferred height to that element. You can also add a Content Size Fitter to the same object as the Vertical Layout Group and set the vertical fit to use preferred size. That should allow you to add as many or as few child elements to the vertical layout group as you wish and that object will always get vertically sized according to how many children it has with each child maintaining its own preferred height.

That worked out great, thanks. One more question if you don’t mind… how do I get the gray Panel in my screenshot to align to the top of my black panel instead of the center? I want to keep the height of the black panel fixed, but I would like everything else within to align to the top.

2339367--158154--ss2.jpg