Comments (6)
改到2.4.4了,只是泛型多了个K extend BaseViewHolder,调整了下发现没有问题啊,你能把你的代码贴下么?我的adapter都会重写onViewAttachedToWindow的,没有报错 @liuyuttkx
from pinnedsectionitemdecoration.
代码更新到v2.6.1了,你拉下再试试? @liuyuttkx
from pinnedsectionitemdecoration.
您好,最终测试发现是我用的studio软件误报. 报错后仍然编译正常运行. (第一次发现会出现这样)但"holder"代码那块一直会报红.
我用的都是线性布局,索性我也不用重写那两个方法. 事情完成解决.
十分感谢楼主!!!!
报错代码如下,报错点在"holder"这里.
@OverRide
public void onViewAttachedToWindow(BaseViewHolder holder) {
super.onViewAttachedToWindow(holder);
FullSpanUtil.onViewAttachedToWindow(holder, this, StockEntity.StockInfo.TYPE_HEADER);
}
from pinnedsectionitemdecoration.
FullSpanUtil.onViewAttachedToWindow(holder, this, StockEntity.StockInfo.TYPE_HEADER)
如果是瀑布流布局,这里处理标签的布局占满一行
原因我可能知道了,它的父方法调用了这个
` public void onViewAttachedToWindow(K holder) {
super.onViewAttachedToWindow(holder);
int type = holder.getItemViewType();
if(type != 1365 && type != 273 && type != 819 && type != 546) {
this.addAnimation(holder);
} else {
this.setFullSpan(holder);
}
}
protected void setFullSpan(ViewHolder holder) {
if(holder.itemView.getLayoutParams() instanceof LayoutParams) {
LayoutParams params = (LayoutParams)holder.itemView.getLayoutParams();
params.setFullSpan(true);
}
}`
然后我再重写的时候super.onViewAttachedToWindow(holder); 所以方法调用两次了,居然会报错~~~
所以你去掉也没问题,但是你不能保证其他框架适配器有做这个吧,所以你看个人情况加咯
from pinnedsectionitemdecoration.
from pinnedsectionitemdecoration.
BaseQuickAdapter不是我写的 其实这里用这个适配器只是方便演示 只要实现任意适配器就行 根据实际情况处理即可
from pinnedsectionitemdecoration.
Related Issues (20)
- 吸顶tab切换 HOT 2
- 每次刷新数据的时候,上面的悬停view会挡住第一行,请问下怎么解决呢 HOT 1
- 配合XRecycleView使用会出现粘性头部和实际数据位置不符的问题
- 设置divider比较宽的时候,最左边第一张图片宽度被压缩,比同行的另外几张窄
- 与databinding 使用 文字不显示
- Header根布局必须使用FrameLayout否则设置背景色无效
- java.lang.ClassCastException: android.widget.FrameLayout cannot be cast to android.widget.TextView
- 设置吸顶decoration,出现如图问题 HOT 1
- ItemDecoration标签点击事件异常(标签布局中部分子View点击事件不生效)
- ![image](https://user-images.githubusercontent.com/6427399/60393522-45f34700-9b49-11e9-821b-94409c372b17.png)
- 点击事件回调方法onHeaderClick(View view, int id, int position)中,第一个参数(被点击的View)可能并不是真实标签中的view, 点击事件中刷新标签UI可能不生效 HOT 1
- 滑动的时候 Rv的srcollbar 的高度会一直变化,一会长一会短 这个有办法处理吗?
- 怎么设置分割线的大小 HOT 1
- RecyclerView的clipToPadding="false"属性不生效
- 怎样实现增量插入更新到对应的组内
- 当悬浮view有网络图片时 加载空白 可能是还没有加载完成时,已经好创建了view
- 自适应宽高的瀑布流
- jcenter 即将于五月一日关停. 可以将库上传到 jitpack.io 之类的地方吗 HOT 1
- header item layout 中 有自定义View 悬浮时不显示
- 这个项目已经很久不维护了,我fork并更新了依赖
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 pinnedsectionitemdecoration.