Prince Bansal
Prince Bansal

Reputation: 1655

How to customize Grid Layout Manager of recycler view?

I have successfully implemented a recycler view with the grid layout manner of span count 2. Now i want to implement something like in the below picture. For this i need to customize my grid layout manager such that the span count for 1 element is 1 and for rest all it is 2. Is there anyway possible.

enter image description here

Upvotes: 3

Views: 6371

Answers (1)

yigit
yigit

Reputation: 38273

Use setSpanSizeLookup to provide this information to the layout manager.

see docs here: https://developer.android.com/reference/android/support/v7/widget/GridLayoutManager.html

Upvotes: 5

Related Questions