我如何创建一个 Flex 列表组件,其 rowIndex 从顶部的底部开始
有谁知道我如何创建一个堆叠列表组件(就像 Photoshop 一样),其中第一行从底部开始,第二行从底部上方开始,依此类推。 通常列表组件的工作方式如下。
0
1
2
3
我需要的是一个像这样工作的列表组件
3
2
1
0
为了说明我的问题,我上传了我需要构建的组件的图片。 倒排列表组件的rowindex必须从底部开始。 这意味着列表中的最低行始终为零。
有谁知道我怎样才能做到这一点?
谢谢
DJ
Does anybody know how i can create a stacking list component (just like photoshop) where the first row starts at the bottom and the second on above the bottom and so on.
Normally the list component works like this.
0
1
2
3
what i need is a list component that works like this
3
2
1
0
To illustrated my question i have uploaded a picture of the component i need to build.
The rowindex of the inverted list component must start at the bottom.
meaning that the lowest row in the list is always zero.
Does anybody know how i can accomplish this?
Thanks
DJ
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
执行此操作的一种方法是始终使用
this.addChildAt(0);
在容器中添加行通过这样做,每个新行将被添加到零索引,并且其顺序将从默认顺序恢复
one way of doing this is to always add the row in the container using
this.addChildAt(0);
by doing this every new row will be added to zero index and its order will be reverted from default order
定义一个新布局来执行此操作。 这个答案有一些起始链接。
确保您的虚拟布局也适用于列表控件(我建议只获取 VerticalLayout 并更改 updateDisplayListReal.
Define a new layout to do this. This answer has some starting links.
Make sure you get the virtual layout working as well for the list control (I suggest just grabbing the VerticalLayout and changing the updateDisplayListReal.
显然你正在将图层信息存储在数组或类似的东西中。只是在将数组分配给列表控件之前反转数组。
现在
它看起来像
obviously you are storing the layers information in array or something like this. just revers the the array before assigning it to list control.
that is
now it will look like