简体   繁体   English

notifyDataSetChanged()重置RecyclerView中的滚动状态

[英]notifyDataSetChanged() resetting scroll state in RecyclerView

Is there a way to implement notifyDataSetChanged() and keep the scroll state in a RecyclerView ? 有没有一种方法可以实现notifyDataSetChanged()并将滚动状态保持在RecyclerView I already tried with notifyItemChanged() and notifyItemRangeChanged() but with the same results. 我已经尝试使用notifyItemChanged()notifyItemRangeChanged()但是结果相同。

notifyItemRangeChanged(0,adapter.getItemCount());

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 recyclerview在notifyDataSetChanged()之后滚动到顶部 - recyclerview scroll to top after notifyDataSetChanged() notifyDataSetChanged 上的反向布局 RecyclerView 中不需要的滚动 - unwanted scroll in reverse layout RecyclerView on notifyDataSetChanged 如何在notifyDataSetChanged之后阻止RecyclerView中的自动滚动? - How to prevent auto scroll in RecyclerView after notifyDataSetChanged? 在创建 state 时将 RecyclerView 重置为其初始状态 - Resetting RecyclerView to its initail onCreate state 如何在RecyclerView中更新适配器notifydatasetchanged后最后设置滚动位置 - How to set scroll position at last after update adapter notifydatasetchanged in RecyclerView 如何在 notifyDataSetChanged 上禁用 recyclerview 滚动到顶部(第一项) - How to disable recyclerview scroll to top (1st item) on notifyDataSetChanged 调用notifydatasetchanged()之后,在Recyclerview中保持视图状态不变 - Keeping state of a view constant in Recyclerview after calling notifydatasetchanged() 在嵌套的 RecyclerView 中保存滚动状态 - Save scroll state in nested RecyclerView 如何更新RecyclerView-notifyDataSetChanged() - How to Update RecyclerView - notifyDataSetChanged() RecyclerView notifyDataSetChanged()不起作用 - RecyclerView notifyDataSetChanged() not working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM