RecyclerView With GridLayoutManager Not Scrollable

Nathan Sokalski 4,116 Reputation points
2023-03-16T23:43:17.47+00:00

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?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,294 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,370 questions
{count} votes