Problem with Android TableRow for children

I have TableLayoutwith 3 lines currently, and each line has one child, a TextView. My problem is that the width TextViewsdoes not match "match_parent", as you would expect. I followed the procedure for determining heights and widths for them ( as the documentation says ), but for some reason the problem still exists.

I opened hierarchyviewerand looked at the values, it TableRowfills the width as it should, but TextViewdoes not fill the line, it is just packing the contents. The full xml layout is below, does anyone have any ideas?

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableRow
    android:layout_width="match_parent"
    android:layout_height="wrap_content">   
    <TextView
        android:background="@drawable/textlines"
        android:text="@string/text1_string"
        android:textColor="#000000"
        android:padding="5dp">
    </TextView>
</TableRow>
<TableRow
    android:layout_width="match_parent"
    android:layout_height="wrap_content">   
    <TextView
        android:background="@drawable/textlines"
        android:text="@string/text1_string"
        android:textColor="#000000"
        android:padding="5dp">
    </TextView>
</TableRow>
<TableRow
    android:layout_width="match_parent"
    android:layout_height="wrap_content">   
    <TextView
        android:background="@drawable/textlines"
        android:text="@string/text1_string"
        android:textColor="#000000"
        android:padding="5dp">
    </TextView>
</TableRow>
</TableLayout>

xml @drawable/textlines. , ? ( textlines ). , , , . , :

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
  <shape 
    android:shape="rectangle">
        <stroke android:width="1dp" android:color="#FF000000" />
        <solid android:color="#FFDDDDDD" />

    </shape>
</item>

<item android:top="1dp" android:bottom="1dp"> 
  <shape 
    android:shape="rectangle">
        <stroke android:width="1dp" android:color="#FFDDDDDD" />
        <solid android:color="#00000000" />
    </shape>
</item>
</layer-list>
+3
1

, , , :

android:layout_weight="1"

TextView s :

android:stretchColumns="0"

TableLayout.

+13

All Articles