In fact, Jarin Kessler brought us the only correct answer here (unfortunately, I have no right to comment on his post, so I do it here).
When your HBox size is based on a percentage, you hope that its size will only affect its container. This is wrong, there is another rule, more powerful. It is the fact that the container (which has HBox) has a minimum size, which is the addition of the default / explicit sizes of its own child components.
So, if your percentage value results in a value smaller than the minimum size, the minimum size wins and applies to the HBox. Since HBox displays all of its children, there is no need for scrollbars.
So using:
minHeight = 0; minWidth = 0;
recalls the story of HBox that its minimum size is 0, not the default. You redefine it, and thus the minimum size is less than a percentage and loses the battle.
The only phrase I found in the Adobe documentation explaining this is this:
Percentage container size is recommended. Flex makes the container large enough to fit its children with minimal dimensions.
I hope I understand
(feel free to correct my incorrect English sentences ...)
user1919265
source share