Skip to content Skip to sidebar Skip to footer

Gridview With Dynamic Number Of Columns In Each Row

How can I recreate the following view with the help of a GridView. The number of items in the list is dynamic.

Solution 1:

I guess that this is not a single GridView but a combination of multiple Layouts. Just make a LinearLayout and decide according to the content, which layout you want to have in a row.

Solution 2:

To obtain the layout you see you can use something like this:

<LinearLayoutandroid:orientation="vertical"><!-- First row --><View /><!-- Second row --><LinearLayoutandroid:orientation="horizontal" /><!-- Third row --><LinearLayoutandroid:orientation="horizontal" /><!-- Fourth row --><View /></LinearLayout>

If you want also the paged effect you can use a ViewPager

http://android-developers.blogspot.it/2011/08/horizontal-view-swiping-with-viewpager.html

Post a Comment for "Gridview With Dynamic Number Of Columns In Each Row"