从适配器更改滚动值时的Recyclerview
问题描述:
我正在开发一个应用程序,试图使用RecyclerView和Recycler适配器填充列表.但是,当我快速滚动浏览列表时,有时列表项上的值会在列表项之间乱七八糟.是否有已知的解决方法?
I am working on an app where I am trying to populate a list using RecyclerView and recycler adapter as well. But when I scroll through the list quickly sometimes values on the list item shuffles among list items. Is there a known fix for this?
答
将其添加到适配器中可以解决此问题
adding this in the adapter solved the problem
@Override
public int getItemViewType(int position)
{
return position;
}