NullPointerException in dissapearence animation of RecyclerView from support v.23.2.0

后端 未结 3 516
眼角桃花
眼角桃花 2021-01-05 18:09


In new RecyclerView we can use wrap_content for height (or for width). So Google fixed bug - https://code.google.com/p/android/issues/detail?id=74772

3条回答
  •  说谎
    说谎 (楼主)
    2021-01-05 18:27

    I had exactly the same error as the one raised in the question and in fact have raised a bug with Google for this. I did find, after delving into the framework code, that I could resolve the issue by changing the setting of HasFixedSize from FALSE to TRUE i.e. "rv.setHasFixedSize(true)". This is basically telling the RecyclerView that changes to its contents will not change the RecyclerView size thus avoiding a full layout. I had originally set this FALSE due to a mis-interpretation of its meaning. This change removes the fault for me and is a reproducible solution.

提交回复
热议问题