Below is what my screen looks like:
You can see that in row 1, the two buttons are not aligned evenly since the right box is 2 lines and the left box is 1 line. Also, you can see in row 3 that the buttons are wider since they are both 3 lines each.
Is there a way to make the rows the same height? Sort of like how in a LinearLayout
you can use android:layout_width="#"
. I have posted all the code in my XML since it is relatively short.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/relativelayout"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="1dp"
android:paddingBottom="50dp"
android:background="@drawable/scroll" >
<TextView
android:id="@+id/header"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textSize="14sp"
android:layout_centerHorizontal="true"
android:gravity="center"
android:paddingTop="65dp" />
<TextView
android:id="@+id/subHeader"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/header"
android:textStyle="italic|bold"
android:textSize="12sp"
android:layout_centerHorizontal="true"
android:gravity="center"
android:paddingBottom="20dp" />
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/subHeader"
android:layout_alignParentBottom="true"
android:background="@drawable/scrollviewborder"
android:fillViewport="true"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="8dp"
android:paddingBottom="8dp" >
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1" >
<Button
android:id="@+id/jc"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:textStyle="bold"
android:textSize="14sp" />
<Button
android:id="@+id/tencommandments"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:textStyle="bold"
android:textSize="14sp" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1" >
<Button
android:id="@+id/exodus"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textStyle="bold"
android:textSize="14sp" />
<Button
android:id="@+id/genesis"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textStyle="bold"
android:textSize="14sp" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1" >
<Button
android:id="@+id/holydays"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textStyle="bold"
android:textSize="14sp" />
<Button
android:id="@+id/facts"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textStyle="bold"
android:textSize="14sp" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1" >
<Button
android:id="@+id/random"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textStyle="bold"
android:textSize="14sp" />
</TableRow>
</TableLayout>
</RelativeLayout>