Android TableRow RelativeLayout Issue

phogel picture phogel · Jan 19, 2010 · Viewed 9.3k times · Source

I have the following

<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/admin_row"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:gravity="center_horizontal">
    <RelativeLayout android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:orientation="horizontal"
                    android:background="@color/silver">

I dynamically populate the table but with the relative layout colored silver it only spans about 3/4 of the table row. If I put a LinearLayout with horizontal orientation it spans completely but if I change it to vertical the same problem occurs. I need a relative layout in the table row because I need to something like this:

Value
Detail MoreDetail.

Any ideas on getting the relative layout to span the table row?

Answer

Eric Burke picture Eric Burke · Apr 28, 2010

Try setting android:stretchColumns="0" or else android:stretchColumns="*" on your TableLayout tag.