当前位置:网站首页>RecyclerView上下滑动时,不调用onBindViewHolder 导致列表的item不刷新
RecyclerView上下滑动时,不调用onBindViewHolder 导致列表的item不刷新
2022-08-10 22:16:00 【今人不见古时月,今月曾经照古人】
前一段时间遇到了一个问题,RecyclerView结合Picasso做了一个网络相册功能,上下来回滑动过程中,有一部分item没有调用onBindViewHolder,导致图片没有下载预览,展示空白。
通过代码调试,当 RecyclerView 从上到下滑动,中间不停顿,这个时候是正常的,onBindViewHolder 会调用,不过此时从底部上划的时候,上方的 item 从不可见到可见的这个过程中,部分item 的onBindViewHolder 并没有调用。
参考一些资料,发现时RecyclerView 的缓存复用机制引起的,不缓存就行了。具体代码如下:
myRecyclerView.setItemViewCacheSize(int); //传入-1 就可解决。边栏推荐
- QT笔记——QT工具uic,rcc,moc,qmake的使用和介绍
- 《DevOps围炉夜话》- Pilot - CNCF开源DevOps项目DevStream简介 - feat. PMC成员胡涛
- "DevOps Night Talk" - Pilot - Introduction to CNCF Open Source DevOps Project DevStream - feat. PMC member Hu Tao
- 商家招募电商主播要考虑哪些内容
- 元宇宙社交应用,靠什么吸引用户「为爱发电」?
- 瑞幸咖啡第二季营收33亿:门店达7195家 更换CFO
- Self-organization is a two-way journey between managers and members
- shell脚本
- Qualcomm Platform Development Series Explanation (Application) Introduction to QCMAP Application Framework
- 2022年8月10日:使用 ASP.NET Core 为初学者构建 Web 应用程序--使用 ASP.NET Core 创建 Web UI(没看懂需要再看一遍)
猜你喜欢

留言有奖|OpenBMB x 清华大学NLP:大模型公开课更新完结!
![[Maui official version] Create a cross-platform Maui program, as well as the implementation and demonstration of dependency injection and MVVM two-way binding](/img/07/2baa3bd1d8da0f868fd49b5bdd0527.png)
[Maui official version] Create a cross-platform Maui program, as well as the implementation and demonstration of dependency injection and MVVM two-way binding

音乐播放器(未完成版本)

QT笔记——用VS + qt 生成dll 和 调用生成的dll

Redis

A shell script the for loop statements, while statement

FPGA - Memory Resources of 7 Series FPGA Internal Structure -03- Built-in Error Correction Function

H3C S5130 IRF做堆叠

DC-7靶场下载及渗透实战详细过程(DC靶场系列)

Black cats take you learn Makefile article 13: a Makefile collection compile problem
随机推荐
美味的石井饭
August 10, 2022: Building Web Applications for Beginners with ASP.NET Core -- Creating Web UIs with ASP.NET Core
This visual tool artifact is more intuitive and easy to use!love so much
DC-9靶场下载及渗透实战详细过程(DC靶场系列)
file IO-buffer
The Thread State,
STL-stack
水果沙拉酱
3598. Binary tree traversal (Huazhong University of Science and Technology exam questions)
JS学习 2022080
服务——DNS正向反向域名解析服务
STL-deque
The perfect alternative to domestic Gravatar avatars Cravatar
Spark基础【RDD转换算子】
"DevOps Night Talk" - Pilot - Introduction to CNCF Open Source DevOps Project DevStream - feat. PMC member Hu Tao
mmpose关键点(一):评价指标(PCK,OKS,mAP)
CIKM2022 | 基于双向Transformers对比学习的序列推荐
geemap的详细安装步骤及环境配置
BM7 list entry in central
高通平台开发系列讲解(应用篇)QCMAP应用框架介绍