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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:03:41+00:00 2026-06-04T15:03:41+00:00

I have a following xml layout in my project (incidentally, if you notice something

  • 0

I have a following xml layout in my project (incidentally, if you notice something else that is also seemingly wrong/not so good yet, I’d appreciate you let me know about it!) and my problem is the attribute “wrap_contents” doesn’t work at the last TextView (“EEE”, txt4). Is there any regulation I overlook?

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

<merge xmlns:android="http://schemas.android.com/apk/res/android">

    <TableLayout
        android:id="@+id/Table"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1">

        <TableRow
            android:id="@+id/tableRow1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical">


            <TextView
                android:id="@+id/txt1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:text="AAA"
                android:textColor="@color/white" />


            <Spinner
                android:id="@+id/spn1"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:entries="@array/array1" />

        </TableRow>

        <TableRow
            android:id="@+id/tableRow2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" >


            <TextView
                android:id="@+id/edt1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:text="BBB"
                android:textColor="@color/white" />

            <Spinner
                android:id="@+id/spn2"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:entries="@array/Tounyuhou" />

            <EditText
                android:id="@+id/edt2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:ems="5"
                android:inputType="numberSigned"/>

            <TextView
                android:id="@+id/txt2"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:text="CCC" android:textColor="@color/white" 
                android:gravity="center_vertical|center_horizontal" 
                android:textSize="18sp"/>

        </TableRow>

        <TableRow
            android:id="@+id/tableRow3"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">



            <TextView
                android:id="@+id/txt3"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|center_horizontal"
                android:text="DDD"
                android:textColor="@color/white" />



            <EditText
                android:id="@+id/edt3"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:gravity="right|center_vertical">

            </EditText>


            <TextView
                android:id="@+id/txt4"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:text="EEE"
                android:textColor="@color/white"
                android:gravity="center_vertical|center_horizontal"
                android:textSize="20sp"/>

        </TableRow>


        </TableLayout>

</merge>
  • 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-06-04T15:03:43+00:00Added an answer on June 4, 2026 at 3:03 pm

    here you define all the rows in same layout , but with different number of views, like row1 contain 2 , row2 contain 4 then row3 contain 3 views,

    so it gives problem,

    so my suggetion take different tablelayout for third row.

    <?xml version="1.0" encoding="utf-8"?>
    
    <merge xmlns:android="http://schemas.android.com/apk/res/android">
    
     <TableLayout
                android:id="@+id/mainTable"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1">
    
                <TableRow
                    android:id="@+id/mainTable_tableRow1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical">
    
            <TableLayout
                android:id="@+id/Table"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1">
    
                <TableRow
                    android:id="@+id/tableRow1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical">
    
    
                    <TextView
                        android:id="@+id/txt1"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                        android:text="AAA"
                        android:textColor="@color/white" />
    
    
                    <Spinner
                        android:id="@+id/spn1"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:entries="@array/array1" />
    
                </TableRow>
    
                <TableRow
                    android:id="@+id/tableRow2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content" >
    
    
                    <TextView
                        android:id="@+id/edt1"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                        android:text="BBB"
                        android:textColor="@color/white" />
    
                    <Spinner
                        android:id="@+id/spn2"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_weight="1"
                        android:entries="@array/Tounyuhou" />
    
                    <EditText
                        android:id="@+id/edt2"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:ems="5"
                        android:inputType="numberSigned"/>
    
                    <TextView
                        android:id="@+id/txt2"
                        android:layout_width="wrap_content"
                        android:layout_height="match_parent"
                        android:text="CCC" android:textColor="@color/white" 
                        android:gravity="center_vertical|center_horizontal" 
                        android:textSize="18sp"/>
    
                </TableRow>
        </TableLayout>
    </TableRow>
    <TableRow
                    android:id="@+id/mainTable_tableRow2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical">
        <TableLayout
                android:id="@+id/Table2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1">
    
                <TableRow
                    android:id="@+id/table2_tableRow3"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">
    
    
    
                    <TextView
                        android:id="@+id/txt3"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical|center_horizontal"
                        android:text="DDD"
                        android:textColor="@color/white" />
    
    
    
                    <EditText
                        android:id="@+id/edt3"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="right|center_vertical">
    
                    </EditText>
    
    
                    <TextView
                        android:id="@+id/txt4"
                        android:layout_width="wrap_content"
                        android:layout_height="match_parent"
                        android:text="EEE"
                        android:textColor="@color/white"
                        android:gravity="center_vertical|center_horizontal"
                        android:textSize="20sp"/>
    
                </TableRow>
    
    
                </TableLayout>
    </TableRow>
     </TableLayout>
    
        </merge>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following XML layout for a ListActivity. <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android
I have the following XML layout file, HELPME.XML <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent
This is maddening. I have the following XML layout: <FrameLayout android:layout_width=fill_parent android:layout_height=wrap_content android:background=@drawable/shadow android:focusable=true
I have the following TextView in my XML layout file:- <TextView android:layout_width=fill_parent android:layout_height=wrap_content android:text=@string/autolink_test
I have the following layout defined for one of my Activities: <?xml version=1.0 encoding=utf-8?>
I have following XML. I was able to remove all namespaces but not able
I have the following layout in XML (splashscreen.xml): <?xml version=1.0 encoding=utf-8?> <FrameLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/frmLayout
I have following in xml I wanna put the second linear layout at the
I have the following xml file <Layout xmlns=http://tempuri.org/Layout/> <Numeric Id=temperature Caption=Temperature> <validation:IsValidWhen xmlns:validation=http://tempuri.org/Validation/> </validation:IsValidWhen>
I have the following XML layout in my android application, using ScrollView: <?xml version=1.0

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.