I have a ViewStack
which is dataProvider
for a TabBar
. There are two VBox
s as children for this ViewStack
. It works fine with absolute values for width and height for these VBox
s, but when specified in percentages, the VBox
uses all the available space (100%) for any percentage value. Please find the code and screen shots below.
Can someone please explain why it is getting rendered so? And also how can children of a ViewStack
be aligned to center? There is no horizontalAlign
property for ViewStack
and it is not working with horizontalCenter= "0"
.
Code:
<mx:ViewStack id="viewStack" width="100%" height="100%" selectedIndex="0" horizontalCenter="0" textAlign="center">
<mx:VBox label="Tab 1" width="25%" height="10%" borderThickness="2" borderColor="red"
borderStyle="solid" horizontalAlign="left">
<mx:Text text="This is tab 1" />
</mx:VBox>
<mx:VBox label="Tab 2" width="30%" height="20%" borderThickness="2" borderColor="haloBlue"
borderStyle="solid">
<mx:Text text="This is tab 2" />
</mx:VBox>
</mx:ViewStack>
Image 1(with absolute values):
Image 2(with width="25%" and height="10%"):
Thanks, Anji