-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
咨询问题,作者大大忙的情况下,就不用回复了
最新版本在使用WrapRecyclerView的时候,设置OnItemClick点击事件时,position不准确,通过debug发现在【BaseAdapter】61行代码处【如下代码】:holder.getAdapterPosition()获取的值使用是-1,所以导致 mPositionOffset默认就会偏移当前屏幕中显示的item数量
@OverRide
public final void onBindViewHolder(@nonnull VH holder, int position) {
// 根据 ViewHolder 绑定的位置和传入的位置进行对比
// 一般情况下这两个位置值是相等的,但是有一种特殊的情况
// 在外层添加头部 View 的情况下,这两个位置值是不对等的
mPositionOffset = position - holder.getAdapterPosition();
holder.onBindView(position);
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working