I have a code similar to this:
<s:VGroup>
<s:HGroup verticalAlign="middle">
<s:Label text="label" />
<s:TextInput id="rmName"/>
</s:HGroup>
<mx:HorizontalList id="imagePreview" width="100%" visible="false"
columnWidth="100" rowCount="1" rowHeight="130" selectable="false" borderVisible="false">
<mx:itemRenderer>
...
</mx:itemRenderer>
</mx:HorizontalList>
<s:VGroup>
I want that the s:VGroup container has the height only of its visible children.
In this example there is a free space even the visibility mx:HorizontalList is set to false. Every time I change the visibility of the child element I want that the parent (s:VGroup) will change his height. How to do this in flex?
As you change the visible attribute from true to false also change the includeInLayout attribute from true to false.