Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5967045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:53:11+00:00 2026-05-22T19:53:11+00:00

I have a simple GUI table-layout I’m trying to design in eclipse, but when

  • 0

I have a simple GUI table-layout I’m trying to design in eclipse, but when I run the app in the emulator, only the title of my application appears. Nothing else that is shown from the eclipse graphical layout window shows up in the emulator. I’ve also tried it on my real device with the same outcome, so I suspect I’m doing something wrong with the code.
Here is the code from the main.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:weightSum="1.0">
<TableLayout 
android:id="@+id/tableLayout1" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent">
    <TableRow
    android:layout_weight=".2"
    android:layout_height="0px" 
    android:layout_width="fill_parent"
    android:id="@+id/tableRow1"
    android:background="@drawable/my_shape_file"> 
    </TableRow>
    <TableRow
    android:layout_height="0dp" 
    android:layout_width="fill_parent" 
    android:id="@+id/tableRow2" 
    android:layout_weight=".001">
        <Button 
        android:text="Button" 
        android:id="@+id/button1" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button2" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button3" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button android:layout_width="0dp" 
        android:layout_height="fill_parent" 
        android:text="Button" 
        android:layout_weight="1" 
        android:id="@+id/button4"></Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button5" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
    </TableRow>    
    <TableRow
    android:id="@+id/tableRow3" 
    android:layout_width="fill_parent" 
    android:baselineAligned="true" 
    android:layout_weight=".02" 
    android:layout_height="fill_parent">
        <TableLayout 
        android:id="@+id/tableLayout2" 
        android:layout_width="0dp" 
        android:layout_height="fill_parent"
        android:layout_weight=".5">                                 
            <TableRow
            android:layout_width="0dp" 
            android:id="@+id/tableRow4" 
            android:layout_height="0dp" 
            android:layout_weight="1">             
                <Button 

                android:id="@+id/button6" 
                android:layout_height="fill_parent" 
                android:layout_width="0dp"
                android:layout_weight="1"
                android:background="@drawable/second_button">
                </Button>
                <Button 
                android:text="Button" 
                android:id="@+id/button7" 
                android:layout_height="fill_parent" 
                android:layout_width="0dp"
                android:layout_weight="1">
                </Button>
                <Button 
                android:text="Button" 
                android:id="@+id/button8" 
                android:layout_height="fill_parent" 
                android:layout_width="0dp"
                android:layout_weight="1">
                </Button>
            </TableRow>                     
            <TableRow
            android:id="@+id/tableRow5"         
            android:layout_width="0dp" 
            android:layout_weight="1" 
            android:layout_height="0dp">
                <Button             
                android:id="@+id/button9" 
                android:layout_height="fill_parent" 
                android:layout_width="0dp"
                android:layout_weight="1"
                android:background="@drawable/second_button">
                </Button>
                <Button 
                android:text="Button" 
                android:id="@+id/button10" 
                android:layout_height="fill_parent" 
                android:layout_width="0dp"
                android:layout_weight="1">
                </Button>
                <Button 
                android:text="Button" 
                android:id="@+id/button11" 
                android:layout_height="fill_parent" 
                android:layout_width="0dp"
                android:layout_weight="1">
                </Button>
            </TableRow> 
        </TableLayout>           
    <TableLayout 
    android:id="@+id/tableLayout3" 
    android:layout_width="0dp" 
    android:layout_height="fill_parent"
    android:layout_weight=".33">        
    </TableLayout>
    </TableRow>
    <TableRow
    android:layout_weight=".01"
    android:layout_height="0dp" 
    android:layout_width="fill_parent" 
    android:id="@+id/tableRow6">
        <Button 
        android:text="Button" 
        android:id="@+id/button12" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button12" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button13" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button14" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button15" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
    </TableRow>
    <TableRow
    android:layout_weight=".01"
    android:layout_height="0dp" 
    android:layout_width="fill_parent" 
    android:id="@+id/tableRow7">
        <Button 
        android:text="Button" 
        android:id="@+id/button16" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button17" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button18" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button19" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button20" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
    </TableRow>
    <TableRow
    android:layout_weight=".01"
    android:layout_height="0dp" 
    android:layout_width="fill_parent" 
    android:id="@+id/tableRow8">
        <Button 
        android:text="Button" 
        android:id="@+id/button21" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button22" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button23" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button24" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button25" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>        
    </TableRow>
    <TableRow
    android:layout_weight=".01"
    android:layout_height="0dp" 
    android:layout_width="fill_parent" 
    android:id="@+id/tableRow9">
        <Button 
        android:text="Button" 
        android:id="@+id/button26" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button27" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button28" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button29" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button30" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
    </TableRow>
    <TableRow
    android:layout_weight=".01"
    android:id="@+id/tableRow10" 
    android:layout_width="fill_parent" 
    android:layout_height="0dp">
        <Button 
        android:text="Button" 
        android:id="@+id/button31" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button32" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button33" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button34" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button35" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
    </TableRow>
    <TableRow
    android:layout_weight=".01"
    android:layout_height="0dp" 
    android:layout_width="fill_parent" 
    android:id="@+id/tableRow11">
        <Button 
        android:text="Button" 
        android:id="@+id/button36" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button37" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button38" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button39" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button40" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
    </TableRow>
    <TableRow
    android:layout_weight=".01"
    android:layout_height="0dp" 
    android:layout_width="fill_parent" 
    android:id="@+id/tableRow12">
        <Button 
        android:text="Button" 
        android:id="@+id/button41" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button42" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button43" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button44" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
        <Button 
        android:text="Button" 
        android:id="@+id/button45" 
        android:layout_height="fill_parent" 
        android:layout_width="0dp"
        android:layout_weight="1">
        </Button>
    </TableRow>
</TableLayout>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:53:12+00:00Added an answer on May 22, 2026 at 7:53 pm

    Make sure that you’ve specified setContentView(R.layout.main) in the onCreate of your Activity.

    There should also be a closing tag for LinearLayout at the end of the document.

    Other than those two issues, this layout works for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a simple GUI with table containing x and y
I have a simple Java SWT app in Java so far but the weird
I am trying to build a simple Java GUI (I've been learning for only
I have a simple GUI component written in Java. The class draws an analog
My use case is very simple : I have a GUI application, and inside
Should simple JavaBeans that have only simple getters and setters be unit tested?? What
I have a simple 2-column layout with a footer that clears both the right
I have some questions regarding data base design for simple CMS. Every Page in
I have created a simple GUI using Windows Forms in visual C++ 2008. There
I have created a simple gui with curses. However, when the curses menu is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.