• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Create main menu layout like Robo Defense

gilangb89

Newbie
Jun 3, 2010
11
1
First of all, I'm sorry if this is in the wrong section.

Hi, I'm new to android. I am used to code in C#, and I'm also developing an application for Windows Phone 7. I found out that creating a simple layout in android took a lot more of effort comparing to Windows Phone 7.

I'm going to create this main menu layout that looks similar to Robo Defense's main menu (the menu where you choose to start game, view achievement, etc).

note: I already put the
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
to the AndroidManifest.xml.

Check the picture below:

nwx2ef.png


It was easy to create that kind of main menu in Windows Phone 7, but I had difficulties in Android when trying to design it from the main.xml file.

I was thinking of using a LinearLayout, and then put a TextView inside the LinearLayout. And after that, I put a TableLayout for the buttons under the TextView. What bugs me is that the table didn't show up, only the text view was displayed.

Then I changed to using LinearLayout again but then put a TableLayout, then put the TextView inside the TableLayout (into a TableRow), hoping that it would be centered inside the table above the buttons. The result is like this:

2nbsj6h.png


The "Title Bar" isn't centered inside the table, and the table layout creates a tablerow with two elements, one of which is empty, and the rows below it change their widths to fit the rows above them.

So that's it, i'm stuck here. What should I do? Any help is appreciated, thank you :)
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones