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 6338405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:26:17+00:00 2026-05-24T19:26:17+00:00

In my app i have a tablelayout with 26 buttons. I have made a

  • 0

In my app i have a tablelayout with 26 buttons. I have made a row of two buttons each.
My code is as follows:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent" 
     android:layout_width="fill_parent" 
     android:scrollbars="vertical">
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_gravity="center"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:scrollbars="horizontal"
android:paddingTop="4.5dp"
android:stretchColumns="**">
<TableRow>
<Button
      android:id="@+id/sp1"
      android:layout_height="40dp"
      android:layout_width="100dp"
       android:background="@drawable/selector3"
      android:layout_marginBottom="7dp"
      android:layout_marginRight="10dp"
      android:text="Preventing Psoric Taint"/>
<Button 
      android:text="Suffocation and Choking" 
      android:layout_height="40dp"
       android:background="@drawable/selector3"
      android:layout_width="100dp"
      android:layout_marginBottom="7dp"
      android:layout_marginRight="10dp"
      android:id="@+id/sp2" />
 </TableRow>
 <TableRow>
<Button
      android:text="Spots on the cranum due to collection of blood" 
      android:id="@+id/sp3" 
      android:layout_height="40dp"
       android:background="@drawable/selector3"
      android:layout_width="100dp"
      android:layout_marginBottom="7dp"
      android:layout_marginRight="10dp"/>
<Button
      android:id="@+id/sp4" 
      android:layout_height="40dp"
      android:layout_width="100dp"
       android:background="@drawable/selector3"
      android:layout_marginBottom="7dp"
      android:layout_marginRight="10dp"
      android:text="Monstrocities and Deformities"/>
</TableRow>
<TableRow> 
<Button
      android:id="@+id/sp5" 
      android:layout_marginBottom="7dp"
       android:background="@drawable/selector3"
      android:layout_marginRight="10dp"
      android:layout_width="100dp"
      android:layout_height="40dp" 
      android:text="Marks and Blemishes"/>
<Button 
      android:id="@+id/sp6"
      android:layout_width="100dp"
       android:background="@drawable/selector3"
      android:layout_height="40dp"
      android:layout_marginBottom="7dp"
      android:layout_marginRight="10dp" 
      android:text="Blue discoloration of the skin"/>
   </TableRow>
   <TableRow>
<Button 
      android:id="@+id/sp7"
      android:layout_width="100dp"
      android:layout_height="40dp"
       android:background="@drawable/selector3"
      android:layout_marginBottom="7dp"
      android:layout_marginRight="10dp" 
      android:text="Swelling of the head"/>
<Button 
      android:id="@+id/sp8"
      android:layout_width="100dp"
      android:layout_height="40dp"
      android:layout_marginBottom="7dp"
       android:background="@drawable/selector3"
      android:layout_marginRight="10dp"
      android:text="Congenital Hernia"/>
    </TableRow>
    <TableRow>
<Button 
      android:text="Induration of cellular tissue"
      android:id="@+id/sp9"
      android:layout_width="100dp"
       android:background="@drawable/selector3"
      android:layout_marginBottom="7dp"
      android:layout_marginRight="10dp"
      android:layout_height="40dp"/>
<Button 
      android:text="Breast swelling"
      android:id="@+id/sp10"
      android:layout_width="100dp"
       android:background="@drawable/selector3"
      android:layout_marginBottom="7dp"
      android:layout_marginRight="10dp"
      android:layout_height="40dp"/>
   </TableRow>
   <TableRow>
<Button 
      android:text="Coryza"
       android:background="@drawable/selector3"
      android:id="@+id/sp11"
      android:layout_width="100dp"
      android:layout_marginBottom="7dp"
      android:layout_marginRight="10dp"
      android:layout_height="40dp"/>   
<Button 
android:text="Opthalmia (Inflammation of eyes)"
 android:id="@+id/sp12"
  android:layout_width="100dp"
   android:background="@drawable/selector3"
  android:layout_marginBottom="7dp"
      android:layout_marginRight="10dp"
   android:layout_height="40dp"/>   
</TableRow>
<TableRow>
<Button 
android:text="Excoriation"
 android:id="@+id/sp13"
  android:layout_width="100dp"
   android:background="@drawable/selector3"
  android:layout_marginBottom="7dp"
      android:layout_marginRight="10dp"
   android:layout_height="40dp"/>
<Button 
android:text="Aphthae"
 android:id="@+id/sp14"
  android:layout_width="100dp"
  android:layout_marginBottom="7dp"
   android:background="@drawable/selector3"
      android:layout_marginRight="10dp"
   android:layout_height="40dp"/>   
</TableRow>
<TableRow>
<Button 
android:text="Spasms on the chest"
 android:id="@+id/sp15"
  android:layout_width="100dp"
  android:layout_marginBottom="7dp"
   android:background="@drawable/selector3"
      android:layout_marginRight="10dp"
   android:layout_height="40dp"/> 
   <Button 
android:text="Convulsions"
 android:id="@+id/sp16"
  android:layout_width="100dp"
  android:layout_marginBottom="7dp"
      android:layout_marginRight="10dp"
       android:background="@drawable/selector3"
   android:layout_height="40dp"/>    
</TableRow>
<TableRow>
   <Button 
android:text="Milk Crust"
 android:id="@+id/sp17"
  android:layout_width="100dp"
  android:layout_marginBottom="7dp"
   android:background="@drawable/selector3"
      android:layout_marginRight="10dp"
   android:layout_height="40dp"/> 
   <Button 
android:text="Red gum"
 android:id="@+id/sp18"
  android:layout_width="100dp"
  android:layout_marginBottom="7dp"
      android:layout_marginRight="10dp"
       android:background="@drawable/selector3"
   android:layout_height="40dp"/> 
</TableRow>
<TableRow>   
   <Button 
android:text="Scald Head"
 android:id="@+id/sp19"
  android:layout_width="100dp"
   android:background="@drawable/selector3"
  android:layout_marginBottom="7dp"
      android:layout_marginRight="10dp"
   android:layout_height="40dp"/>
   <Button 
android:text="Heat Spots"
 android:id="@+id/sp20"
  android:layout_width="100dp"
  android:layout_marginBottom="7dp"
   android:background="@drawable/selector3"
      android:layout_marginRight="10dp"
   android:layout_height="40dp"/>     
</TableRow>
<TableRow>  
  <Button 
android:text="Tetanus"
 android:id="@+id/sp21"
  android:background="@drawable/selector3"
  android:layout_width="100dp"
  android:layout_marginBottom="7dp"
      android:layout_marginRight="10dp"
   android:layout_height="40dp"/> 
   <Button 
android:text="Weaning complaints"
 android:id="@+id/sp22"
  android:background="@drawable/selector3"
  android:layout_width="100dp"
  android:layout_marginBottom="7dp"
      android:layout_marginRight="10dp"
   android:layout_height="40dp"/> 
  </TableRow>
  <TableRow>
   
   <Button 
android:text="Erysipelas"
 android:id="@+id/sp23"
  android:layout_width="100dp"
   android:background="@drawable/selector3"
  android:layout_marginBottom="7dp"
      android:layout_marginRight="10dp"
   android:layout_height="40dp"/>
   <Button 
android:text="Dentition"
 android:id="@+id/sp24"
 android:layout_marginBottom="7dp"
  android:background="@drawable/selector3"
      android:layout_marginRight="10dp"
  android:layout_width="100dp"
   android:layout_height="40dp"/>  
  </TableRow>
  <TableRow>
   
    <Button 
android:text="Bed Wetting"
 android:id="@+id/sp25"
 android:layout_marginBottom="7dp"
  android:background="@drawable/selector3"
      android:layout_marginRight="10dp"
  android:layout_width="100dp"
   android:layout_height="40dp"/>
   
   <Button 
android:text="Worms"
android:layout_marginBottom="7dp"
      android:layout_marginRight="10dp"
       android:background="@drawable/selector3"
 android:id="@+id/sp26"
  android:layout_width="100dp"
   android:layout_height="40dp"/>
     
   </TableRow>                    
</TableLayout>
</ScrollView>

And it looks like this when i run it in the emulator:
enter image description here

The top four buttons get completely hidden. Does anyone know why this is happening. Please help. Thanks in advance.

  • 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-24T19:26:18+00:00Added an answer on May 24, 2026 at 7:26 pm

    To fix your problem you need to change:

    near:

    <TableLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_gravity="center"
    android:layout_height="fill_parent"
    android:layout_width="fill_parent"
    android:scrollbars="horizontal"
    android:paddingTop="4.5dp"
    android:stretchColumns="**">
    

    from:

    android:layout_gravity="center"

    to

    android:layout_gravity="top"

    This will make your TableView be anchored by `ScrollView’ from the top and not from the center.

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

Sidebar

Related Questions

I have the following layout for my andriod app. <?xml version=1.0 encoding=utf-8?> <TableLayout xmlns:android=http://schemas.android.com/apk/res/android
Ok I have declared my main.xml as follows <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=wrap_content
i have a problem with my scrollview... my xml: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=wrap_content android:layout_height=wrap_content>
my app have action bar on top of windows. Where are some buttons. Buttons
I have a command line app and have the code chdir(/var); FILE *scriptFile =
I have a List of TableLayout's that are each generated from data in my
tI have 2 radio buttons, 1 is defaulted to start as true, when app
I have popup in my android app. In popup I have button for closing
I have two ImageView s, one TextView and one Gallery in my app and
I have a TableLayout in my app, which I need to define and add

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.