我有一个ViewStack内的2 VBox容器和视图堆栈是在HBox里面,我已经设置了vboxes的高度和宽度都为100%,视图堆栈也是一样的。 我的问题是,viewstack不显示容器childs的全部内容只是其中的一部分,并显示一个垂直滚动,虽然宽度被拉伸以填充容器hbox的整个宽度,但viewstack为什么不延伸要显示其孩子的100%身高,并仅为宽度显示?ViewStack高度问题
主要申请包含含有加载包含则ViewStack
主应用程序的模块的模块加载器控制的HBox中:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalScrollPolicy="on"
xmlns:custom="components.*">
<custom:RepeatingImage source="images/up_bg.gif" width="100%" height="100%" repeatX="true" repeatY="false" />
<mx:Canvas width="100%">
<custom:header id="header" />
<mx:HBox id="content" horizontalGap="12" width="100%" x="12" y="180">
<mx:ModuleLoader id="contentModuleLoader" width="100%" />
<custom:sidead />
</mx:HBox>
</mx:Canvas>
<custom:footer id="footer" />
</mx:Application>
模块:
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:custom="components.*" width="100%">
<mx:LinkBar dataProvider="stack" />
<mx:ViewStack id="stack" width="100%">
<mx:VBox id="Content" label="First View" width="100%">
<mx:Canvas width="100%">
//controls here
</mx:Canvas>
<mx:Canvas width="100%">
<mx:HBox width="100%">
<mx:VBox width="100%">
//more controls and containers
</mx:VBox>
</mx:HBox>
</mx:Canvas>
</mx:VBox>
<mx:VBox label="Second View">
//controls
</mx:VBox>
</mx:ViewStack>
</mx:Module>
你可以发布一些示例代码?设置每个组件的宽度和高度的线应该是我们需要的。 – invertedSpear 2010-03-09 15:31:24
我添加了代码 – Yasmine 2010-03-10 11:50:29