简体   繁体   English

在Flex3中创建未选择任何子项的自定义手风琴组件

[英]Creating a custom Accordion component with no child selected in Flex3

Any worked on custom Accordion component with no child selected. 任何在未选择子项的情况下在自定义手风琴组件上工作的人。 The following is my requirement 以下是我的要求

By default on initial load of Accordion, only headers have to be shown. 默认情况下,在手风琴初始加载时,仅显示标题。 On each header click, only the clicked header and the respective container should be visible. 每次单击标题时,只有被单击的标题和相应的容器应该可见。 If we clicked again on header, the Accordion will be moved to initial state. 如果再次单击标题,则手风琴将移至初始状态。

These features should work similary how the Accordion will work with all TWEEN effects. 这些功能应与手风琴如何与所有TWEEN效果一起工作类似。

Thanks in Advance. 提前致谢。

I implemented a similar concept with a TabNavigator. 我使用TabNavigator实现了类似的概念。

My implementation used the following steps: 我的实现使用以下步骤:

Initialize the container with height = 0 初始化高度为0的容器

Add a mouse-click listener to the container (onCapture=true, because tabNavigator kills the click event, not sure if you need this for Accordion container) 将鼠标单击侦听器添加到容器中(onCapture = true,因为tabNavigator会杀死click事件,不确定是否需要Accordion容器使用此事件)

In the click handler, add/remove tabs depending on the state and change height to appropriate values (back to zero if coming from open tab to closed container, from 0 to 100% if going from closed to open). 在点击处理程序中,根据状态添加/删除选项卡,并将高度更改为适当的值(如果从打开的选项卡更改为关闭的容器,则将高度更改为零;如果从关闭的选项卡更改为关闭的容器,则将高度更改为0%到100%)。

Yes, this is very high level, but the question was asked months ago. 是的,这是很高的水平,但是这个问题是在几个月前提出的。 If you are watching it, and you are still in need of more detail, please comment and I can help. 如果您正在观看它,但仍需要更多详细信息,请发表评论,我可以提供帮助。

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

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