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

查看:16
本文介绍了Recyclerview 关于从适配器更改的滚动值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,我正在尝试使用 RecyclerView 和回收器适配器填充列表.但是,当我快速滚动列表时,有时列表项上的值会在列表项之间随机播放.有没有已知的解决方法?

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天全站免登陆