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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:23:40+00:00 2026-05-21T15:23:40+00:00

EDIT: Does TableLayout not work properly? I see most of you say use relative

  • 0

EDIT:
Does TableLayout not work properly? I see most of you say use relative layout, and skip tableview?

enter image description here

The SPACE on after Data 1 and Data 2 I was trying to get rid of. If I put the same XML code without the TableLayout then it looks to be ok. What do I change?

The 3rd row with the “100” I wanted 2 entry textviews on the right side. I have tried everything I can think of and it will not go to the right. I removed the 2nd textview to see if that helped, but didnt make much difference.

Can anyone tell me what I did wrong? thank you!

Here is the XML:

<?xml version="1.0" encoding="utf-8"?>

<ScrollView android:layout_width="fill_parent"
    android:layout_height="wrap_content">


    <TableLayout android:layout_width="fill_parent"
        android:stretchColumns="*" android:layout_height="fill_parent"
        android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"
        android:padding="6px">

        <TableRow style="@style/FormRows" android:layout_marginTop="15sp">
            <Button android:layout_width="fill_parent"
                android:layout_height="wrap_content" android:layout_marginLeft="5px"
                android:layout_span="3" android:layout_weight="1" android:text="Save"
                android:id="@+id/dgSave" />
        </TableRow>



        <TableRow style="@style/FormRows">

            <TextView android:layout_width="70sp"
                android:layout_height="wrap_content" android:textSize="16sp"
                android:layout_weight="1" android:text="Data 1" />

            <Spinner android:id="@+id/dgData0" android:layout_weight="2"
                android:layout_width="wrap_content" android:layout_height="wrap_content" />

        </TableRow>



        <TableRow>

            <LinearLayout android:orientation="horizontal"
                android:layout_width="fill_parent" android:layout_height="wrap_content">

        <EditText android:text="100" android:selectAllOnFocus="true"
                    android:imeOptions="actionNext" android:numeric="integer"
                    android:width="100sp" android:id="@+id/dgWarn0" android:gravity="right"
                    android:layout_height="wrap_content" android:layout_weight="1"
                    android:layout_gravity="right" android:layout_span="2" />


                <EditText android:text="100" android:selectAllOnFocus="true"
                    android:imeOptions="actionNext" android:numeric="integer"
                    android:width="100sp" android:id="@+id/dgWarn1" android:gravity="right"
                    android:layout_height="wrap_content" android:layout_weight="1"
                    android:layout_gravity="right" android:layout_span="2" />

            </LinearLayout>

        </TableRow>

        <TableRow style="@style/FormRows">

            <TextView android:layout_width="70sp"
                android:layout_height="wrap_content" android:textSize="16sp"
                android:layout_weight="1" android:text="Data 2" />

            <Spinner android:id="@+id/dgData1" android:layout_weight="2"
                android:layout_width="wrap_content" android:layout_height="wrap_content" />

        </TableRow>


    </TableLayout>
</ScrollView>

THANK YOU! for any help!!!
Mark

  • 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-21T15:23:40+00:00Added an answer on May 21, 2026 at 3:23 pm

    Here’s what a RelativeLayout might look like. I did this kind of quickly… it’s missing some other margins, etc… but it’s a starting point.

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >
        <Button android:id="@+id/save"
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content" 
            android:layout_alignParentTop="true"
            android:layout_centerHorizontal="true"
            android:layout_margin="20dp"
            android:text="Save" />
        <Spinner android:id="@+id/spinner1"
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:layout_alignRight="@id/save" />
        <TextView
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:layout_toLeftOf="@id/spinner1"
            android:text="Data 1" />
        <EditText android:id="@+id/editbox"
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:layout_alignRight="@id/save"
            android:layout_below="@id/spinner1" />
        <Spinner android:id="@+id/spinner2"
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:layout_alignRight="@id/save"
            android:layout_below="@id/editbox" />
        <TextView
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:layout_toLeftOf="@id/spinner2"
            android:text="Data 2" />
    </RelativeLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT I isolated a real minimal example which does not work (it is a
EDIT: It does work (sorry). Something in this script is causing it to stop
how does one use code to do this: produce 15 random numbers [EDIT: from
I tried to use this Watermark it does work correctly on my test project,
JPA Controller class method edit() does not check if entity already exist instead adds
Edit #2: Does anyone have a good method of testing the middle of a
Ryan Bates' nifty_scaffolding, for example, does this edit.html.erb <%= render :partial => 'form' %>
does anyone know how you edit/maintain regions in magento - specifically adding ones for
EDIT I'm looking for the actual one or two liner that does what the
Does anyone know how can I edit a subitem on a listView? I've tried

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.