EditText in a tableRow how to fix 100%

android, android-layout

Solution

Try this, add to `TableLayout` `stretchColumns` param

<TableLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:stretchColumns="1"
            >

Problem

I have a linearlayout with a table and a button, the table has EditText and TextView, my problem is with EditText, which is too small ``` <LinearLayout android:orientation="vertical" android:layout_width="300dip" android:layout_height="350dip" android:background="@drawable/background_resto" > <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center" > <TableLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" > <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity ="center" > <TextView android:id="@+id/nameRegister" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#000000" android:text="Nombre" android:layout_marginLeft="10dip" /> </TableRow> <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity ="center" > <EditText android:id="@+id/registerName" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:layout_marginLeft="10dip" android:layout_marginRight="10dip" /> </TableRow> </TableLayout> <Button android:id="@+id/butRegister" android:layout_height="35dip" android:layout_width="wrap_content" android:text="Enviar" /> </LinearLayout> </LinearLayout> ``` I would like the EditText fix the 300dip that the first linearLayout, but I don't get it, what should I do?

Original source