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
Asked
Active
Viewed 170 times
1 Answers
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