is there a way to implement the following feature in my app? Should have a Gridview like behavier, but with different rowheights. Or is there another wigdet, which provide such a feature? (Adapter, n-columns, etc) I spent the last 3 days with trying and catching but i didn't get any matching solution
Asked
Active
Viewed 1,476 times
5
-
actually not.. I just was wondering why the iOS grid can handle such a requirement... I mean, on a device this grid would look great – tobi.g Mar 07 '12 at 03:17
-
Hi g.tobi, how did you solve this problem? – Wayne Dec 05 '12 at 06:09
1 Answers
1
In the layout.xml, use a Linear Layout first, with horizontal orientation.
Within this linear layout, put 4 linear layouts, with vertical orientation, setting the weight attribute to 1 for all of them. (So that each of the column occupies same space).
Now, each of the four linear layouts, put the image view's or buttons and give the weight accordingly. So if the weight is 1, 1, 2 for 3 buttons in a linear layout, the 3rd button size appears twice the size of first or second.
So this will surely solve your problem. But this is only true when you have static no. of levels. You need to make it generic based on the no. of levels, and still it will work.
Let me know if you have any questions.
Nithin

nithinreddy
- 6,167
- 4
- 38
- 44
-
1Hm, yeah, I already did this yesterday, but it looks like this is not the fastest implementation and far away from resource-saving. I already looked in the GridView.java source, but it looks like I have to rebuild this from scratch. But anyway, thanks for the awnser. – tobi.g Mar 07 '12 at 03:24