Large gap forms between RecyclerView items when scrolling down

前端 未结 9 1855
别跟我提以往
别跟我提以往 2020-12-23 20:16

I\'m making a ToDo list app, and while testing it, for some reason, a huge gap forms between the items whenever I try to scroll down. It always happens whenever I Drag and D

相关标签:
9条回答
  • 2020-12-23 20:59

    Its because you are using match_parent in height of root view of the row item in your vertically oriented listview/recyclerview. When you use that the item expands completely wrt to its parent. Use wrap_content for height when the recyclerview is vertically oriented and for width when it is horizantally oriented.

    0 讨论(0)
  • 2020-12-23 21:06

    This happened to me many times!

    All you need to do is... make layout_height of row file wrap_content and your problem solved..

    android:layout_height="wrap_content"

    Happy coding!

    0 讨论(0)
  • 2020-12-23 21:06

    if someone is using | recyclerViewObject.setHasFixedSize(true);

    try removing it, It was causing the issue in my case.

    0 讨论(0)
提交回复
热议问题