RecyclerView With GridLayoutManager Not Scrollable
Nathan Sokalski
4,116
Reputation points
I have 2 RecyclerView
(s): One using a LinearLayoutManager
, one using a GridLayoutManager
. The LinearLayoutManager
works great, and allows me to scroll vertically as I want. The GridLayoutManager
, however, refuses to scroll. Here is the xml for the RecyclerView
with a GridLayoutManager
:
<androidx.recyclerview.widget.RecyclerView android:id="@+id/rvHomeData" android:layout_width="wrap_content" android:layout_height="0dp" android:layout_column="1" android:layout_row="1" android:layout_rowWeight="1"/>
When I run my app, the RecyclerView
's items are cropped to make all items visible rather than allowing the user to scroll. Here is the code used to set the GridLayoutManager
:
this.rvHomeData.SetLayoutManager(new GridLayoutManager(this, 33, GridLayoutManager.Horizontal, false));
How can I make the RecyclerView
with a GridLayoutManager
scroll rather than crop the items?