i want to make Recycle view contain grid and linear manager i tried to use this answer this but it not work with me
Asked
Active
Viewed 188 times
1 Answers
1
You have 2 options to do this:
- use a grid layout manager, and for items on rows 2 onward you use a cell span of 2, so each item occupies the whole row (see https://developer.android.com/reference/android/support/v7/widget/GridLayoutManager.SpanSizeLookup.html)
- use 2 different view types, 1 for the first row containing 2 children, and then a different view type for all the other items (see https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter.html#getItemViewType(int))

Francesc
- 25,014
- 10
- 66
- 84