ViewStack高度问题

Yas*_*ine 1 apache-flex

我在ViewStack中有2个VBox容器,而viewstack在HBox里面,我已经将vbox的高度和宽度设置为100%,并且视图堆栈也是如此.我的问题是视图堆栈不显示容器子项的整个内容只是它的一部分并显示垂直滚动,虽然宽度被拉伸以填充容器hbox的整个宽度,为什么视图堆栈不会延伸到显示其孩子的100%高度,仅适用于宽度?

主应用程序包含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>
Run Code Online (Sandbox Code Playgroud)

模块:

<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>
Run Code Online (Sandbox Code Playgroud)

LE *_*oît 7

你试过resizeToContentviewStack 的属性吗?