views:

26

answers:

3
+1  Q: 

[ANDROID] Grid 3*3

Hey, i want to have a grid with 3 columns and 3 rows and an image button in each cell (center of cell)

i tried with gridview but i can't fix the number of rows i tried with a tablelayout and 3 tablerows, but i can't change width/height at runtime

any idea ?

sry for english, i'm french ;)

A: 

If you're using a tablelayout you just need to do the following on each ImageButton:

this.setPadding(0, 0, 0, 0);
this.setScaleType(ScaleType.CENTER_INSIDE);
Cpt.Ohlund
ok, that works very well, thanks :)
GeeXor
A: 

my problem is not with the imagebuttons but width grid i want the grid to fill the screen and the 9 cells to take the whole screen with the same dimensions

GeeXor
A: 
http://mobiforge.com/designing/story/understanding-user-interface-android-part-3-more-views

check last example here. i think it help you

ud_an