Comments (3)
你好,控件是有View的复用,我特意又打了断点测试了一下,没办法做到二维的完全复用,但是并不是每次都执行onCreateViewHolder 方法,你可以简单的测试下,打开Demo,向右滑到底后,再向左滑onCreateViewHolder 就不执行了(上下滑同理)。或者你可以在 onCreateViewHolder 打log,然后看看滑动新增可见的View 的个数 是否==onCreateViewHolder执行的个数来判断有无View复用。或者看下源码,是一个二维的Recycler 叠加的控件,实现原理有视图缓存的,只是不能很完全每个View都做到复用。
from scrollablepanel.
非常感谢你的回复。
其实我们俩说的是同一回事,可能我之前的表达有误。我的意思是能不能提供一个类似于convertView的机制,将滑出屏幕的视图进行回收,让即将展现的视图使用被回收的视图,这样只需要调用(一屏的view个数多一点)次onCreateViewHolder方法,或许可以提高性能,解决卡顿现象。
ps:非常喜欢这个库,使用简单方便,自定义程度高,只是横滑的卡顿着实让体验大打折扣。我最近也有抽空学习源码,希望能贡献自己的一份力量。再次感谢分享。
from scrollablepanel.
搜索了很多资料,依然没搞清楚RecyclerView的回收机制,索性今天抽空用ListView写了个类似的库,由于使用的是原生ListView,所以保留了ListView的特性。因为我感觉ListView的回收机制好控制一些,实现了一样的效果,差不多解决了卡顿问题吧。。如果可以的话请指导一下,谢谢!
https://github.com/z3896823/PanelList
from scrollablepanel.
Related Issues (20)
- 回顶部
- 在更新数据的情况下,滑动不够流畅
- 能不能向右滑动的时候 出现轮播动画效果
- 可以去掉固定的第一列吗? HOT 3
- 滑动错位
- item显示不全
- Is it possible to adjust colum and row sizes?
- 如何添加整行点击事件
- 能否实现拖拽人任意交换两个Item
- 合并单元格?
- 如何自适应宽高?
- 刷新的时候怎么清空缓存
- 和子布局控件抢占焦点
- How can I get the Recycler View to load new data!?
- notifyDataSetChanged()频繁刷新oom? HOT 2
- 求助,横向滑动卡顿的问题,哪位大神有解决方案 HOT 1
- 如何监听滑动事件
- Misfit androidX
- 帮忙改个闪烁的bug
- 日期列显示会少一列 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scrollablepanel.