zincpower / jrecycleview Goto Github PK
View Code? Open in Web Editor NEW简单的让RecycleView更有趣
简单的让RecycleView更有趣
作者你好:
我在项目中使用到你的框架遇到了个问题:
在全局设置 下拉样式:如下
JRecycleViewManager.getInstance().setLoadMoreView(new MyLoadMoreView(getBaseContext()));
因为 在项目中有不止一处地方用的了 上拉加载更多。。所以设置了统一样式。。以此为背景。
遇到这个异常:ViewHolder views must not be attached when created. Ensure that you are not passing 'true' to the attachToRoot parameter of LayoutInflater.inflate(..., boolean attachToRoot)
看源码发现: if (holder.itemView.getParent() != null) {
throw new IllegalStateException("ViewHolder views must not be attached when"
+ " created. Ensure that you are not passing 'true' to the attachToRoot"
+ " parameter of LayoutInflater.inflate(..., boolean attachToRoot)");
}
如果设置了全局MyLoadMoreView 作为ViewHoder 复用的时候会出现 第一次 不会有问题。。但是如果项目中 有二个地方已经以上用到的话: holder.itemView(MyLoadMoreView ).getParent 是值 是第一次 JRrecycleView 就这在里报出了异常。 我现在的做法是 在每个用到 jRecycleView 的时候。都
MyLoadMoreView myLoadMoreView = new MyLoadMoreView(context);
jRefreshAndLoadMoreAdapter.setLoadMoreView(myLoadMoreView);
都设置了这个新的 MyLoadMoewView 这样 解决了这个问题。。希望作者的库越来越好。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.