GridView? (solved)

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

GridView? (solved)

Postby waynesilver » Wed Mar 17, 2010 6:25 pm

OK so I want to write a game and I need a grid of selectable fields that will start some user actions. The closest example I can think of is "Battleship" by Milton Bradley.

My question is this: How do you display a grid on the Android? I tried GridView, and I can't figure out how to get the grid elements to shrink to the point where they all fit onto one non-scrollable screen. I would like to use GridView, because it solves more problems for me than it causes, but I am open to suggestions on other widgets.

I would like to have a grid of selectable fields on the screen "n" columns wide by "m" rows high. This grid can't be scrollable and must fill the screen. I don't know how big n or m is, because I have to experiment with the UI to see how many pieces I can divide the screen into, before it becomes impossible to differentiate between the elements. For now, id like to start with a 10X15 grid on the screen.

I figured out how do manipulate the buttons and get the sizes I needed by using a combination of tableview and relativeview. Those gave me the most control over spacing and sizing.
Posts: 28
Joined: Mon Jan 04, 2010 9:01 pm
Location: Seattle


Return to Novice Tutorials

Who is online

Users browsing this forum: Google Feedfetcher and 3 guests