带有SectionIndexer的Android RecyclerView

Jus*_*tin 13 android listview sectionindexer android-recyclerview

有人知道如何使用SectionIndexer或RecyclerView的替代品?SectionIndexer允许ListView在快速滚动时弹出部分.

rub*_*ees 2

问题是 RecyclerView 与 ListView 不同。RecyclerView 仅回收 View,仅此而已。这就是您可能发现的没有 FastScroll 选项的原因。

您现在可以做什么:

  1. 用FastScroll实现一个LayoutManager以及你自己想要的效果
  2. 使用图书馆。(我找到了这个: https: //github.com/danoz73/RecyclerViewFastScroller,但尚未测试)
  3. 使用列表视图。我认为它并没有随着 RecyclerView 的发布而废弃,因为它涵盖了像您这样的用例。

检查此问题以获取更多信息:How to add a fast-scroller to the RecyclerView

一篇关于ListView和RecyclerView区别的有趣文章:https://www.bignerdranch.com/blog/recyclerview-part-1-fundamentals-for-listview-experts/