TableLayout has a TextView and an EditText for each row. When an EditText has multiple rows, a TableRow wraps it, but when a TextEdit , it does not ...
Nice 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: 
But when both controls are TextEdit , it displays 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>
Refers to: 
What should I do for Android to display the first layout correctly?
Ps: I already tried to add the attributes android:layout_width="fill_parent" , android:layout_height="wrap_content " to the TableRow , TextView , EditText controls, nothing has changed.
source share