Comments (8)
ListViewTestActivity 中将listView.setAdapter(test01(data)); 替换为listView.setAdapter(test02(data));,发现在 createItem 中出错,type为null
from commonadapter.
你可以测试一下onBindViewHolder调用前都会自动调用一次,getItemType方法。这个和listview的getItemType不同。
rcv的流程是:
在onCreateViewHolder前调用getItemType方法来得到item的类型,将类型传入onCreateViewHolder(ViewGroup parent, int viewType)中
在onBindViewHolder 前会调用一次getItemType来得到类型。
from commonadapter.
如果觉得有问题也可以测试一下看看,谢谢你的指出。我可以去排查下别的地方会不会有这个问题
from commonadapter.
截图里面的那个方法我这边源码看不到,我的RecycleView版本也是23.1.1。我这边bindViewHolder是在getViewForPosition里面调用。奇怪,都是同一版本。
截图如下:
from commonadapter.
这个你可以在代码里面测试一下吧,看看最终的结果。这样靠谱一点。
from commonadapter.
已经找到了这个问题,正在解决@gyh
from commonadapter.
@gyh问题是我在CommonAdapter构造方法中,忘记传了一个item的类型数目,你写上3就行。我稍后会改下demo。
new CommonAdapter(data, 3)
这个是demo的问题,不是库的问题。所以没什么影响,同时谢谢你的反馈。我以后会强制传递一个count。
如果解决了你的问题,你可以close掉这个问题
from commonadapter.
在最新的demo中已经解决了这个问题,请验证
from commonadapter.
Related Issues (20)
- 缺少ExRcvAdapterWrapper HOT 1
- test
- 请问如何去获取点击item所对应的数据? HOT 2
- RecyclerView MemoryLeak HOT 5
- 如何动态的设置List来实现更多加载或者上拉刷新功能 HOT 1
- RecyclerView加载数据显示不完全。 HOT 7
- ViewHolder中的item问题 HOT 5
- 增加recycleview或者adapter上的item的clicklistener,并且要能和item内部的监听器共存 HOT 1
- 如何更新Item构造函数中传入的的非泛型数据呢? HOT 4
- RecycleView RecycleViewPool 中存在内存泄漏,每次显示时候RecycleViewPool 中RcvAdapterItem会增加。 HOT 10
- 为什么在Scrollview 里面 嵌套 recyclerview 的时候,使用这个CommonAdapter的话,recyclerview 是可以正常展示的呢? HOT 5
- 依赖失败 HOT 4
- 没有loadingmore的api么 HOT 1
- debug版本无法运行 HOT 2
- 2.2.1 依赖失败 HOT 3
- setHeaderView 横向滚动支持,内部类包权限限制方法重写 HOT 2
- Eclips
- Eclips怎么使用?有jar包吗? HOT 1
- 我这样做 item局部刷新 发现布局还是会复用 出现状态重复显示的ui HOT 1
- 添加头部后,无法动态remove掉 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 commonadapter.