I've this situation:
A main component where root node is .
In this VBox I explicit the property verticalGap = "0".
In the creation complete, I add a lot of components, in this way:
var pnlFirstCmp:PnlFirstCmp = new PnlFirstCmp();
this.addElement(pnlFirstCmp);
for (var i:int = 1; i<myArray.length; i++) {
var pnlOtherCmp:PnlOtherCmp = new PnlOtherCmp();
this.addElement(pnlOtherCmp);
}
var pnlFooter:PnlFooter = new PnlFooter();
this.addElement(pnlFooter);
Now, problem is: when I see my panel there are some spaces among the different panel that I added at runtime.
Where I'm wrong!?!?!?
EDIT AFTER COMMENT: My root node:
<mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"
creationComplete="vbox1_creationCompleteHandler(event)"
verticalGap="0">
Creation complete:
protected function vbox1_creationCompleteHandler(event:FlexEvent):void
{
createPanel();
}
PnlFirstCmp (node root):
<mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"
verticalGap="0">
PnlOtherCmp (node root):
<mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"
verticalGap="0">
PnlFooter (node root):
<mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%" verticalGap="0">
If you want show other bit of codes, don't esitate ;)
I've resolved.
The issue is: height="100%" in the root node!
I'm creating panel to rumtime and if I remove the height = "100%" Flex builds the panel for the exact dimension, otherwise it builds considering all available height, so add blank space at the footer of panel. In this way I've removed the blank space, so that OK. Thank you for your help Sunil D. & Zeus