0

I want to create a recyleview Layout with 2 columns. There should be a variable that has 2 columns in them.Clicking on them should bring up a toast message

atozcodes
  • 1
  • 2
  • 13

1 Answers1

0

Add a GridLayoutManager to your recyclerview when you set it up with adapter etc, like this:

recyclerview.setLayoutManager(new GridLayoutManager(context, 2));

The 2 is the number of columns. To be clear if you are a beginner, the context param can usually be changed to "this" or getContext() since you usually set the recyclerview up in an activity.

Vanheden
  • 582
  • 5
  • 14