简体   繁体   English

如何在点击时隐藏视图?

[英]How to Hide View on click?

I'm building my own "slide in" menu with SplitViewNavigator in Flash Builder with Flex and ActionScript 3. 我正在使用Flash Builder和Flex和ActionScript 3在SplitViewNavigator中构建自己的“幻灯片”菜单。

I need help on how to show/hide the left view. 我需要有关如何显示/隐藏左视图的帮助。 I'm aware that I should use the visible=false/true but I don't know how to make the view disappear via the button click. 我知道我应该使用visible = false / true,但是我不知道如何通过单击按钮使视图消失。

I have a button as you can see and It calls a function, but what should the function do? 如您所见,我有一个按钮,它调用一个函数,但是该函数应该做什么? Something with if visible = false/true? 如果可见=假/真? The name of the left view that I want to hide is "Meny". 我要隐藏的左视图的名称是“ Meny”。

So basically I want to know how to hide the left view via a button click. 所以基本上我想知道如何通过单击按钮隐藏左视图。

<s:SplitViewNavigator width="100%" height="100%">

        <s:ViewNavigator id="meny" width="70%" height="100%" firstView="views.Meny"/>
        <s:ViewNavigator title="Content" id="content" width="100%" height="100%" firstView="views.Content">
            <s:navigationContent>
                <s:Button label="Meny" click="button1_clickHandler(event)"/>
            </s:navigationContent>
        </s:ViewNavigator>
    </s:SplitViewNavigator>

Thanks 谢谢

Have you tried <s:Button click="svn.getViewNavigatorAt(0).visible=false" label="Click"/> . 您是否尝试过<s:Button click="svn.getViewNavigatorAt(0).visible=false" label="Click"/> If your button is in the same view as the split navigator, you can simply say meny.visible-=false 如果您的按钮与拆分导航器处于同一视图中,则只需说出meny.visible- = false

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM