I want to have a square which contains four buttons with no gaps between them and perhaps a border around the four buttons, I have been experimenting with table layouts as I feel these are easier to control layouts. I have reverted back to my original layout for this question as my latest attempt was a mess. You can see just now I have two buttons per row, I feel there should be four but it goes all wonky when I put four in. Here is my layout:
<TableRow
android:layout_gravity="center_horizontal"
android:layout_weight="1" >
<Button
android:id="@+id/button1"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_column="0"
android:layout_weight="1"
android:gravity="center_horizontal" />
<Button
android:id="@+id/button2"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_column="0"
android:layout_weight="1"
android:gravity="center_horizontal" />
</TableRow>
<TableRow
android:layout_margin="0dp"
android:layout_weight="1" >
<Button
android:id="@+id/button3"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_column="0"
android:layout_weight="1"
android:gravity="center_horizontal" />
<Button
android:id="@+id/button4"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_column="0"
android:layout_weight="1"
android:gravity="center_horizontal" />
</TableRow>
Can anyone explain to me how I can achieve what I want? I also tried nesting table rows which of course failed. The documentation only further confused me, any advice is appreciated!