Hello,
Welcome to our Microsoft Q&A platform!
The second parameter of the GridLayoutManager's constructor method is spanCount. It represents represents the number of rows or columns in this direction. When the third parameter is GridLayoutManager.Horizontal
, 'spanCount' represent the rows. So please set the third parameter to GridLayoutManager.Vertical
instead.
adapter = new CustomAdapter(this, data);
var layoutManager = new GridLayoutManager(this, number, GridLayoutManager.Vertical, false);
recyclerView.SetAdapter(adapter);
recyclerView.SetLayoutManager(layoutManager);
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.