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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:47:45+00:00 2026-06-15T20:47:45+00:00

TableLayout has a TextView and EditText on each row. When EditText has a multiple

  • 0

TableLayout has a TextView and EditText on each row. When EditText has a multiple row, TableRow wraps it but when TextEdit, it doesn’t..

Simplyfied layout:

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:shrinkColumns="*" >

    <TableRow>

        <TextView
            android:id="@+id/textView1"
            android:text="Lorem ipsum dolor sit amet, consectetur" />

        <EditText
            android:id="@+id/textView2"
            android:text="Foo" />
    </TableRow>

    <TableRow>

        <TextView
            android:id="@+id/textView3"
            android:text="Foo" />

        <EditText
            android:id="@+id/textView4"
            android:text="Lorem ipsum dolor sit amet, consectetur" />
    </TableRow>

</TableLayout>

Renders:Render 1

But when both controls are TextEdit, it renders correctly.

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:shrinkColumns="*" >

    <TableRow>

        <TextView
            android:id="@+id/textView1"
            android:text="Lorem ipsum dolor sit amet, consectetur" />

        <TextView
            android:id="@+id/textView2"
            android:text="Foo" />
    </TableRow>

    <TableRow>

        <TextView
            android:id="@+id/textView3"
            android:text="Foo" />

        <TextView
            android:id="@+id/textView4"
            android:text="Lorem ipsum dolor sit amet, consectetur" />
    </TableRow>

</TableLayout>

Renders as: Render 2

What should i do for Android to render first layout correctly?

Ps: I have already tried to add android:layout_width="fill_parent",android:layout_height="wrap_content” attributes to TableRow, TextView, EditText controls, nothing has changed.

  • 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-15T20:47:47+00:00Added an answer on June 15, 2026 at 8:47 pm
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >
    
        <TableLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" >
    
            <TableRow
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:weightSum="4" >
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="1dp"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="1dp"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="1dp"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
            </TableRow>
    
            <TableRow
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="1dp"
                android:orientation="vertical"
                android:weightSum="4" >
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="1dp"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="1dp"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="1dp"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
            </TableRow>
    
            <TableRow
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="1dp"
                android:orientation="vertical"
                android:weightSum="4" >
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="1dp"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="1dp"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="1dp"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
            </TableRow>
    
            <TableRow
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="1dp"
                android:orientation="vertical"
                android:weightSum="4" >
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="1dp"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="1dp"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="1dp"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
            </TableRow>
    
            <TableRow
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="1dp"
                android:orientation="vertical"
                android:weightSum="4" >
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="1dp"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="1dp"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="1dp"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
            </TableRow>
    
            <TableRow
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="1dp"
                android:orientation="vertical"
                android:weightSum="4" >
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="1dp"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="1dp"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="1dp"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
    
                <TextView
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:background="#B0B0B0" />
            </TableRow>
        </TableLayout>
    
    </LinearLayout>
    

    these Gray cells r textboxes

    enter image description here

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

Sidebar

Related Questions

I have following UI hierarchy Scroll View -->TableLayout-->Rows [each row has TextView+EditText] Problem Inside
I have a layout that contains a TableLayout with three rows. Each row has
I have TableLayout in my project which contains 6 TableRow layouts. Each TableRow layout
My LinearLayout has a few TableRow elements, each of which contain a TextView and
I have seen examples of ListView where each row has multiple view objects, like
On my TableLayout, one TableRow has a TextView, and another has a Spinner. When
Context: I have a TableLayout (created using XML), which has one TableRow, which has
I'm adding rows to my TableLayout dynamically and each row has more than one
I have two EditText controls in one TableLayout>TableRow. I have another TableLayout>TableRow that has
i have a simple tablelayout each table row has the following components image view1

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.