Looking for simple example of table layout...

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Looking for simple example of table layout...

Postby tbennett » Sun Dec 07, 2008 8:08 am

I'm writing a drum-machine app and trying to create a very basic layout of 2 rows of 4 button views per row. I'm completely confused by the TableLayout and am starting to think that's not even the way to go for what I'm trying to do. I'm looking for the equivalent of an HTML table, where I can create 2 rows of 4 buttons where each button is equal sized and spaced to fill the layout-size of the overall table (both width and height). No matter what combination I try of "wrap_content" and "fill_parent" on the TableLayout, TableRow, or individual Button's, I can't seem to get it to layout correctly. I saw an article here about a user-created layout (MyGrid, or something like that), but it looks like that doesn't work in SDK v1.0, but it seemed to be EXACTLY what I'm looking for.


Also, is there some secret resource you guys are using for documentation? I'm self taught and have been using .Net, where I got spoiled by MSDN's documentation where they explain the class in detail AND give working examples of actual use, the android documentation has been painful to work with at best.

Gracias in advance.
tbennett
Junior Developer
Junior Developer
 
Posts: 13
Joined: Sun Dec 07, 2008 7:58 am

Top

Postby gauntface » Sun Dec 07, 2008 2:01 pm

I've just been mucking around with table layout and found some useful info:

Useful Site 1

Useful Site 2

In terms of documentation I'm the same as you, finding it hard to fully understand how to do stuff.

But its still in early stages.
gauntface
Junior Developer
Junior Developer
 
Posts: 10
Joined: Tue Nov 11, 2008 11:16 am

Postby tbennett » Wed Dec 10, 2008 8:18 am

Thanks for the links. I ended up just using a GridView and playing with the horizontal & vertical spacing to get the effect I was looking for. Actually, for what I'm doing the TableLayout would have been much less efficient anyway. BUT, the reading was helpful, so thanks again.
tbennett
Junior Developer
Junior Developer
 
Posts: 13
Joined: Sun Dec 07, 2008 7:58 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 4 guests