0

How to display recycle view items in three rows and three columns using grid layout manager horizontally that add value vertically increase similar to the following figure

1  4  7
2  5  8
3  6  9
HR.SZ
  • 1
  • 2

2 Answers2

0

Use RecyclerView with adapter and write this line:

final GridLayoutManager manager = new GridLayoutManager(getContext(),3);
catProRecycleView.setLayoutManager(manager);
catProRecycleView.setAdapter(categoryProductAdapter);
showdev
  • 28,454
  • 37
  • 55
  • 73
0

You need to specify that your GridLayoutManager is HORIZONTAL. Like this:

gridLayoutManager = new GridLayoutManager(getContext(), 3, GridLayoutManager.HORIZONTAL, false);

3 is number of rows.

More info: How to implement horizontal gridlayoutmanager

Kubik
  • 610
  • 7
  • 15