Here’s what I’m trying to do: Have a panel that contains 3 panels stacked vertically. The top and bottom panels have a fixed size, and the middle panel needs to autoexpand to fill in the space in the middle.
However, for the life of me, I can’t quite figure out how to get this to work using Unity UI.
Here’s what I’ve tried so far:
Container panel: Add a vertical layout group. Child control size and force expand for width is checked. Height is left unchecked.
Top panel: Add a layout element, set min and preferred height to 128.
Bottom panel: Add a layout element, set min and preferred height to 128.
Center panel: ??? I’m stuck here.
I’m about ready to throw in the towel, and just stick a script on the center panel to set its height by subtracting 256 from the container panel’s height, but that feels hacky to me.
Am I missing something obvious?