I have a DialogFragment that contains a RecyclerView (a list of cards).
DialogFragment
RecyclerView
Within this RecyclerView are one or more CardVi
CardVi
i suggest you to put the recyclerview in any other layout (Relative layout is preferable). Then change recyclerview's height/width as match parent to that layout and set the parent layout's height/width as wrap content. it works for me