BaseRecyclerViewAdapterHelper icon indicating copy to clipboard operation
BaseRecyclerViewAdapterHelper copied to clipboard

Called attach on a child which is not detached: BaseViewHolder

Open andyhaha opened this issue 2 years ago • 3 comments

version:3.0.7 Fatal Exception: java.lang.IllegalArgumentException Called attach on a child which is not detached: BaseViewHolder{de9678c position=1 id=-1, oldPos=-1, pLpos:-1 not recyclable(1)} androidx.recyclerview.widget.RecyclerView{

andyhaha avatar Jun 10 '22 07:06 andyhaha

有人提供一下帮助吗 help!

andyhaha avatar Jul 07 '22 02:07 andyhaha

recyclerView系统bug默认动画导致的,去掉默认动画就可以了

Qiang11 avatar Mar 20 '23 09:03 Qiang11

或许新版已经修复,但用旧版懒得升级的,就需要注意下使用方式。

在添加了 header 的情况下,notify item 时,其位置应该是:

notifyItemChanged(index + headerLayoutCount) 其中 index 为需要更新的条目位置, headerLayoutCount 是可以在 adapter 中直接获取到的一个方法,写法为 kotlin 所以显示看着是变量。

ZeQiangFang avatar Nov 07 '23 03:11 ZeQiangFang