10

I'm using GridLayoutManager(GLM) in my RecyclerView. In the RecyclerView, I will populate the CardViews, how can I set my GLM to render only one CardView in the whole screen ?

If I set the span size as 1, it renders one CardView per row, not whole screen.

In Simple, I want to show 1 CardView occupying two columns and two rows. How to achieve this ?

Neha Shukla
  • 3,572
  • 5
  • 38
  • 69
Kamalakannan J
  • 2,818
  • 3
  • 23
  • 51
  • Did you find a solution for this? – osrl Nov 25 '16 at 14:20
  • Could you please post your recycler view item layout? I think if you simply set height of root view in item layout to "match_parent", it will do what you want. However, if you want to divide screen 2x2 grid and want to show one item occupying all these grids, you need to us StaggeredGridLayoutManager. – ycagri Apr 05 '17 at 13:16

1 Answers1

-1

Just double the height of the card for it to take the space of 2 rows. The height of each row is dependent on the single item you inflate (in your case a cardView).

Akash Popat
  • 420
  • 3
  • 18