本文介绍了找出 ListView 中的哪些项目是可见的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 ListView 中找出当前 visibleinvisible 的项目?
例如,我在 ListView 中有 100 个项目,当我滚动到屏幕或列表顶部时,我想检测哪些项目从视口中出现或消失.

插图:

解决方案

你也可以使用

How can I find out which items are currently visible or invisible in a ListView?
For example, I have 100 items in ListView and when i scroll to top of screen or list, I want to detect which items appear or disappear from the viewport.

Illustration:

解决方案

You can also use inview_notifier_list. It's basically a normal ListView which defines a visible region and it's children get notified when they are in that region.

这篇关于找出 ListView 中的哪些项目是可见的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-18 04:41
查看更多