【问题标题】:How to scroll item by item in RecyclerView如何在 RecyclerView 中逐项滚动
【发布时间】:2019-09-05 06:37:00
【问题描述】:

如何在水平 RecyclerView 中逐项滚动? 我不想滚动或平滑滚动 RecyclerView 中的所有项目。

【问题讨论】:

  • 如果我正确理解您的“逐项”,您很可能需要android.support.v7.widget.PagerSnapHelper
  • 确实如此。我需要 android.support.v7.widget.PagerSnapHelper。非常感谢

标签: android android-recyclerview scroll horizontal-scrolling smooth-scrolling


【解决方案1】:
val snapHelper = PagerSnapHelper()
snapHelper.attachToRecyclerView(recyclerView)

确实有效,但您也可以将 ViewPager 用于小列表

【讨论】:

  • 确实如此。非常感谢亲爱的 Mukhit
猜你喜欢
  • 1970-01-01
  • 2019-03-15
  • 1970-01-01
  • 1970-01-01
  • 2017-12-06
  • 2018-11-06
  • 1970-01-01
  • 2019-03-11
  • 1970-01-01
相关资源
最近更新 更多