https://i.stack.imgur.com/C9m5g.jpg
The first image is the way my app looked before I made the EditText into a table row.
After I made it into a table row, the row underneath became resized, even though they all have the same weight.
However, I want the EditText to be in a table row, so I can I make it even again?
Original xml layout file:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/TableLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="5dp"
android:shrinkColumns="30"
android:stretchColumns="20" >
<EditText
android:id="@+id/editText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="numberSigned"
android:layout_weight="3">
<requestFocus/>
</EditText>
<TableRow
android:id="@+id/tableRow1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<Button
android:id="@+id/button7"
style="?android:attr/buttonStyleSmall"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="enterNum"
android:text="@string/num7" />
<Button
android:id="@+id/button8"
style="?android:attr/buttonStyleSmall"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="enterNum"
android:text="@string/num8" />
<Button
android:id="@+id/button9"
style="?android:attr/buttonStyleSmall"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="enterNum"
android:text="@string/num9" />
<Button
android:id="@+id/buttonDiv"
style="?android:attr/buttonStyleSmall"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="enterOp"
android:text="@string/div" />
</TableRow>
Changed code:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/TableLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="5dp"
android:shrinkColumns="30"
android:stretchColumns="20" >
<TableRow
android:id="@+id/tableRow
1 Answer