RecyclerView with wrap_content does not animate well

When I have RecyclerView height as wrap_content as below

 <android.support.v7.widget.RecyclerView android:id="@+id/myRecyclerView" android:layout_width="match_parent" android:layout_height="wrap_content"/> 

The result is as shown below.

enter image description here

This is because resizing occurs before the animation.

This is described in more detail at https://medium.com/@elye.project/recyclerview-supported-wrap-content-not-quite-f04a942ce624#.n7xivnrdr

Is there a way to make it animate first, but only resize it?

+5
source share
1 answer

It makes no sense to use wrap_content as the height of the RecyclerView . Scrolling will not work this way. Set the height to match_parent or add other rules, but avoid wrap_content

+1
source

Source: https://habr.com/ru/post/1259544/


All Articles