2

I have a TextView inside of the TableRow. Is there any way to set a FILL_PARENT width to this TextView?

Edited: Doesn't FILL when I have a backgroundImage to the TableRow

<TableLayout android:id="@+id/tableLayout1"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <TableRow android:layout_height="wrap_content" android:id="@+id/tableRow1"
        android:layout_width="fill_parent" android:background="@drawable/myImage">
        <TextView android:text="I wrapped!" android:id="@+id/textView1"
            android:layout_width="fill_parent" android:background="@color/white"
            android:layout_height="wrap_content"></TextView>
    </TableRow>
</TableLayout>
Jason Aller
  • 3,541
  • 28
  • 38
  • 38
coffee
  • 3,048
  • 4
  • 32
  • 46

1 Answers1

1

Your link answers your question.

The children of a TableRow do not need to specify the layout_width and layout_height attributes in the XML file. TableRow always enforces those values to be respectively MATCH_PARENT and WRAP_CONTENT

FILL_PARENT (renamed MATCH_PARENT in API Level 8 and higher)

Your TextView should automatically be FILL_PARENT which is MATCH_PARENT.

Sachin Chavan
  • 5,578
  • 5
  • 49
  • 75
Tyler Ferraro
  • 3,753
  • 1
  • 21
  • 28