RecyclerView is cutting off the last item

前端 未结 19 2220
予麋鹿
予麋鹿 2020-12-02 18:47

I have a fragment with a toolbar and a recyclerView inside it.

I am populating the recyclerView with dummy data and then try to show them. For some reason, the last

19条回答
  •  一生所求
    2020-12-02 19:07

    I had the same problem (even missing an entire ViewHolder element from my list) while using a RecyclerView inside a ConstraintLayout. As Sila Siebert mentioned, setting layout_width and layout_height of the RecyclerView to zero did the trick. It's a bit confusing cause the editor jumps back to say "match_constraints" after a bit while the XML-text says 0dp. Don't let it confuse you, it should work.

提交回复
热议问题