i need to have a gridview of linearlayouts. Each linearLayout must have a imageview and a relativelayout children with more childrens on it.
I’m searching for tutorials/examples of creating gridviews of LinearLayouts but i can’t find nothing.
Someone haves a tutorial or can give me some examples or help to do this?
thanks
Yes, it’s possible and is quite simple indeed. When you use your GridView, provide an Adapter to it. In the adapter’s
getviewmethod, you can create any view you like and return it. For example, you can inflate a view from XML – and that xml may contain aLinearLayout. Alternatively, you can create a linear layout on the fly in that method and add other components to it.Have a look at this article on Google: http://developer.android.com/resources/tutorials/views/hello-gridview.html
Update: a small example
In your
res/layout/item.xmlThen in your adapter: