Baserecyclerviewadapterhelper: java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false isAttached:true

Created on 2 Dec 2016  ·  5Comments  ·  Source: CymChad/BaseRecyclerViewAdapterHelper

针对这个问题,只有极少部分手机使用才会有这种现象。是因为每次切换频繁导致的这个问题,解决办法:我看stackfllows上面有很多都说要对RecyclerView设置android:animationlayoutChanges = true,才可以解决bug,但是我设置了然并卵,只能知己慢慢找原因,最后我每次在setNewData方法后面加上notifyDataChanged就会减少相应的报错几率,但是问题根本诶有得到解决,最后只能研究布局。那个图我贴不上上,尽量减少对recyclerView父布局的属性。具体情况请问我:QQ:70637935

All 5 comments

700072394c8f00bf172d27fdeafa8f27

留档便于查询

最后解决办法: android:focusableInTouchMode="true"在recyclerView布局里面加这个属性就OK了

@AngelBo 大兄弟,666啊,为什么会这样啊,你知道吗?

以上答案都不能解决问题啊

Was this page helpful?
0 / 5 - 0 ratings