动态折叠 Spark BorderContainer 不会折叠其子项

发布于 2024-09-17 19:07:19 字数 1715 浏览 9 评论 0原文

protected function lbHideQuery_clickHandler(event:MouseEvent):void
        {
            if (lbHideQuery.selected)
            {
                lbHideQuery.label = "Show Query Panel";
                origHeight = canvas1.height;
                canvas1.height = 0;

            }
            else
            {
                lbHideQuery.label = "Hide Query Panel";
                canvas1.height = origHeight;

            }
        } 
    ]]>
</mx:Script>
<mx:LinkButton  label="Hide Query Panel" id="lbHideQuery" toggle="true" click="lbHideQuery_clickHandler(event)"/>
<mx:Canvas id="canvas1" width="100%" height="20%" backgroundColor="0x353356">
<mx:VBox width="16%" height="90" minHeight="0" minWidth="0" id="vgbtns">
        <mx:Button label="Button 1"/>
        <mx:Button label="Button 2"/>
        <mx:Button label="Button 3"/>
</mx:VBox>      

但在 Flex 4 中,当 BorderContainer 折叠时,按钮仍然可见。

            }
        } 
    ]]>
</fx:Script>
<mx:LinkButton  label="Hide Query Panel" id="lbHideQuery" toggle="true" click="lbHideQuery_clickHandler(event)"/>
<s:BorderContainer width="100%" height="25%" backgroundColor="0x353356" id="bc1" >
    <s:layout>
        <s:HorizontalLayout paddingLeft="6"/>
    </s:layout>
    <s:VGroup width="16%" height="90" minHeight="0" minWidth="0" id="vgbtns">
        <s:Button label="Button 1"/>
        <s:Button label="Button 2"/>
        <s:Button label="Button 3"/>

    </s:VGroup>
</s:BorderContainer>

protected function lbHideQuery_clickHandler(event:MouseEvent):void
        {
            if (lbHideQuery.selected)
            {
                lbHideQuery.label = "Show Query Panel";
                origHeight = canvas1.height;
                canvas1.height = 0;

            }
            else
            {
                lbHideQuery.label = "Hide Query Panel";
                canvas1.height = origHeight;

            }
        } 
    ]]>
</mx:Script>
<mx:LinkButton  label="Hide Query Panel" id="lbHideQuery" toggle="true" click="lbHideQuery_clickHandler(event)"/>
<mx:Canvas id="canvas1" width="100%" height="20%" backgroundColor="0x353356">
<mx:VBox width="16%" height="90" minHeight="0" minWidth="0" id="vgbtns">
        <mx:Button label="Button 1"/>
        <mx:Button label="Button 2"/>
        <mx:Button label="Button 3"/>
</mx:VBox>      

but in Flex 4 when the BorderContainer collapses the buttons are still visible.

            }
        } 
    ]]>
</fx:Script>
<mx:LinkButton  label="Hide Query Panel" id="lbHideQuery" toggle="true" click="lbHideQuery_clickHandler(event)"/>
<s:BorderContainer width="100%" height="25%" backgroundColor="0x353356" id="bc1" >
    <s:layout>
        <s:HorizontalLayout paddingLeft="6"/>
    </s:layout>
    <s:VGroup width="16%" height="90" minHeight="0" minWidth="0" id="vgbtns">
        <s:Button label="Button 1"/>
        <s:Button label="Button 2"/>
        <s:Button label="Button 3"/>

    </s:VGroup>
</s:BorderContainer>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

拿命拼未来 2024-09-24 19:07:19
if (lbHideQuery.selected)
            {
                lbHideQuery.label = "Show Query Panel";
                origHeight = canvas1.height;
                canvas1.height = 0;
                canvas1.visible= false;

            }
            else
            {
                lbHideQuery.label = "Hide Query Panel";
                canvas1.height = origHeight;
                canvas1.visible= true;
            }
if (lbHideQuery.selected)
            {
                lbHideQuery.label = "Show Query Panel";
                origHeight = canvas1.height;
                canvas1.height = 0;
                canvas1.visible= false;

            }
            else
            {
                lbHideQuery.label = "Hide Query Panel";
                canvas1.height = origHeight;
                canvas1.visible= true;
            }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文