0

嗨,有一个折叠面板作为分隔盒的组件之一。它可以展开和折叠,并且分隔框在展开/折叠时自行调整。

但是一旦我手动移动/调整分隔线,当我折叠面板时分隔框不会自动调整。因此创建了空白空间 id。任何帮助表示赞赏

4

1 回答 1

0

我认为您应该使用 DivideBox 的 resizeToContent 属性检查以下代码

<mx:HDividedBox width="500" height="200" resizeToContent="true"/>

resizeToContent 属性用于在折叠面板时根据子宽度、高度调整您的容器,根据新的高度和宽度,dividebox 会自行调整。

resizeToContent was set true. And it is working fine until I adjust the divider. Once it is adjusted, it wont get re-sized with the child size.

当用户未在 HDivdebox 上方为容器设置宽度或高度属性时,resizeToContent 属性将起作用我设置了宽度和高度属性,这就是它不起作用的原因...尝试以下代码...在下面的代码中,我使用 HDivideBox 和 TitleWindow 作为其child... TitleWindow 有自己的高度和宽度,并且 HDivideBox 的 resizeToContent 属性设置为 true。当用户单击关闭按钮时,它的宽度会减小,并且 HDivideBox 会根据孩子的总宽度调整自身大小

protected function t1_closeHandler(event:CloseEvent):void
    {
        t1.width = 50;  
    }

protected function t2_closeHandler(event:CloseEvent):void
    {
        t2.width = 50;
    }

<mx:HDividedBox  resizeToContent="true">
        <mx:TitleWindow id="t1" width="150" height="100" showCloseButton="true"  close="t1_closeHandler(event)"/>
        <mx:TitleWindow id="t2" width="150" height="100" showCloseButton="true" close="t2_closeHandler(event)"/>
</mx:HDividedBox>
于 2012-04-20T10:02:40.557 回答