从适配器更改滚动值时的Recyclerview [英] Recyclerview on Scrolling values changing from adapter

查看:52
本文介绍了从适配器更改滚动值时的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;
}

这篇关于从适配器更改滚动值时的Recyclerview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆