隐藏 Flex 面板中的内容窗格
我正在 Flex 3.2 中编写一个自定义组件来扩展面板组件。用户执行特定操作后,我想隐藏面板组件中的主要内容区域,以及控制栏(如果指定)。关于如何做到这一点有什么想法吗? controlBar.visible 似乎没有隐藏控制栏,除了迭代主面板的所有子项之外,我不知道访问主要内容区域的另一种简单方法,如果可能的话,我想避免这种情况。谢谢
I am writing an custom component in Flex 3.2 that extends the panel component. After a user performs a certain action I would like to hide the main content area in the Panel component, as well as the Control Bar if one is specified. Any ideas on how to do this? controlBar.visible does not seem to hide the control bar, and I don't know of another easy way of accessing the main content area besides iterating through all the children of the main panel, and I would like to avoid that if possible. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您不能在包含所有子项的面板中设置一个主容器(无论是 HBox 还是 VBox 等),然后您可以根据用户的操作切换该容器的可见性。
至于 ControlBar ,您应该能够更改其可见性值......
Couldn't you set one main container, whether a HBox or VBox etc... inside your Panel that would contain all the children, then you could toggle this container visibility depending on the user's action.
As for the ControlBar , you should be able to change its visibility value...
您似乎无法隐藏控制栏的原因是因为您只是设置它的可见属性 - 它仍然占用它的空间。因此,要真正“隐藏”它,请执行以下操作:
myControlBar.includeInLayout = false;
另外,要隐藏所有孩子,只需要一个简单的循环:
因此,整个应用程序将如下所示:
希望有帮助!
The reason you can't seem to hide the controlbar, is because you are only setting it's visible property - it's still taking up it's space. So, to truly "hide" it, do this:
myControlBar.includeInLayout = false;
Also, to hide all you children, only requires a simple loop:
So, the entire application would look like this:
Hope that helps!