Im trying to make a tic-tac-toe game(android version). I want to make all the 9 buttons auto-sizing regarding to the width and the height of the device and put them evenly in a 3*3 grid. But I can only set the number for their sizes now. Can anyone tell me how to let them use the height and width of the parent and calculate their sizes?
Also, im using the grid layout now. Is this the best layout I should use for the tic-tac-toe game?
Thanks.
I am working on the exact same problem and got this to work with table layout. Hope this helps.
`
Use
LinearLayouts
withandroid:weightSum
andandroid:layout_weight
Edit
Example :
Try this :
You can use GridView. It will distribute buttons evenly.
in your activity use this code
GridView gridView;