如何使用虚拟布局获取

如何使用虚拟布局获取

本文介绍了如何使用虚拟布局获取 Spark List 上的可见项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我有:

  • 一个数组集合;
  • 使用上述 ArrayCollection 作为数据提供者的 List,并且 virtualLayout=true;
  • 一个自定义的 ItemRenderer,显示一个标签:a) 数量b) y 位置取决于数字和可见的最高数字

换句话说,如果我在 AC 中有 10 个数字,而屏幕上只出现 5 个,那 5 个的 y 位置将取决于这 5 个数字的最大值.当然,当用户滚动时这 5 个元素发生了变化,因此项目渲染器中标签的位置也会发生变化.

In another words, if I have 10 numbers in the AC, and only 5 appear on the screen, the y position of those 5 will depend on the value of the maximum number for those 5. When the user scrolls, of course those 5 elements change so the position of the label in item renderers will change.

我的问题:

1) 如何获取当前"可见的项目列表?2) 要覆盖的事件/方法将帮助我知道列表已滚动/可见项目已更改?

1) How can I get the list of items that are "currently" visible?2) Which event/method to override will help me know that the List was scrolled/the visible items changed?

谢谢,

若昂·萨利罗

推荐答案

getItemIndicesInView():Vector.返回此数据组中可见的项目渲染器的索引.

getItemIndicesInView():Vector.<int>Return the indices of the item renderers visible within this DataGroup.

这篇关于如何使用虚拟布局获取 Spark List 上的可见项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 14:38