Reputation: 5639
Im trying to create a gridview with different width/height..
basically suppose the first column has an image 100x100, the next column will have an image of 50x50 and the next column will have anther image of 50x50.. but for the next row, the first column will be empty and only the second and third column will be populated
basically a row will look something like this
____ _ _
| ||_||_|
|____||_||_|
I need to do this with a grid view and just cant figure it out. Can you possibly specify width/height of grids, or something like weight for grids, or do I have to incorporate another layour for on of the columns of the gridview? thanks in advance.
update: my current idea is to to make a gridview of 4 columns. suppose we have two rows, this would be something like:
a b c d
e f g h
where a to h are images. now, for a, but an image with width and height programatically set to overlap b,f and e, and for b,f,e put a blank image..but this seems to be a very VERY bad approach....
Upvotes: 2
Views: 2813
Reputation: 367
You can look at the code here. It gives you ability to customise item width and height based on one multiple.
The effect I have achieved is showed below. Hope it can help you.
_____ _
|_____|| |
|_|_|_||_|
Upvotes: 1
Reputation: 8049
You can use a GridLayout inside a GridView with a single column, or a GridLayout inside a ScrollView (with a LinearLayout).
Upvotes: 0