gpt4 book ai didi

android - 如何在 ListView 中制作可触摸和可移动的滚动条

转载 作者:太空狗 更新时间:2023-10-29 14:23:27 25 4
gpt4 key购买 nike

我创建了一个 ListView ,其中包含大量数据。 Traditional Scrolling很慢。

我想创建可触摸的 ScrollView ,以便用户可以触摸滚动条并将其移动到任意位置,从而快速滚动列表。那么,有什么办法可以让滚动条可以拖动到列表中的任意位置。

一种方法(我能想到的)是使用 Section Indexer

Interface that should be implemented on Adapters to enable fast scrolling in an AbsListView between sections of the list. A section is a group of list items to jump to that have something in common. For example, they may begin with the same letter or they may be songs from the same artist.

但我在这种情况下填充的列表不一定按任何顺序排序(甚至不按字母顺序排列)。那么,有没有其他有效的方法在 ListView 中实现可拖动的 ScrollView

最佳答案

也许你可以在这里看看:https://github.com/nolanlawson/CustomFastScrollViewDemo

你也可以看看其他类似的帖子:Fast Scroll display problem with ListAdapter and SectionIndexer

祝你好运

关于android - 如何在 ListView 中制作可触摸和可移动的滚动条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14601025/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com