unable to create grid view with wrap_content height or how to create Different Columns Sizes Grid View in android

- 21
- 4
-
Is that okay mr Ed George? – ashish231992 Sep 01 '15 at 13:51
-
I think his question is pretty valid - just asked a bit confused – ligi Sep 01 '15 at 14:03
3 Answers
You might try the StaggeredGridLayoutManager in combination with a RecyclerView
https://developer.android.com/reference/android/support/v7/widget/StaggeredGridLayoutManager.html

- 39,001
- 44
- 144
- 244
-
I can Create Two way Grid View from Staggered Grid View, But How to Create a grid View that i explained above using image. – ashish231992 Sep 02 '15 at 07:01
-
The image was not there when answering the question. The image looks more like a use-case for spans – ligi Sep 02 '15 at 08:27
-
Yes, I just put this image to make you understand that where i am confused.. :P – ashish231992 Sep 02 '15 at 08:40
You need GridLayout, because RecyclerView + StaggeredGridLayoutManager allows only different size of items' height, but all columns will have size of maximum item width, so smaller items will be aligned inside column. Check my answer from here: https://stackoverflow.com/a/36110913/4288054

- 1
- 1

- 1,611
- 1
- 23
- 31
https://drive.google.com/file/d/1AyLqj2aPNNrA80USlJ4mzCD3V8U2zczj/view?usp=sharing
I have made an asymmetric layout in android programmatically because its an easy way to manage all things.
please see the code link have attached in also visit video after I have created the view we gain the above video output
code link - https://gist.github.com/axarlotwala/bd987cf9a39303b0bd3ea1406e477ef7
please vote Up and subscribe for new unique thing and please vote my code

- 539
- 2
- 17