View Full Version : Correct way to size a panel

3 Jul 2012, 12:58 PM
I have a panel with an hbox layout and two child items. Basically I want to the panel to size itself (height-wise) based on the child items. The child items do not have a fixed height.

If do not set a height on my panel, it collapses to a single pixel in height. Is there something I'm doing wrong here? Currently I'm working on writing a listener which checks the height of the child items and resizes the parent based on the tallest child. This seems like a lot of work for something that should be simple.

Any help is appreciated.

3 Jul 2012, 1:11 PM
It should Just Work on 4.1

As long as the child items yield a height upon layout, then the Panel should acquire their height.

Of course we need to see code.