I have a TableLayout
and a matrix of 8 by 8 small buttons described via XML
. When you rotate the screen, some buttons are not visible.
How can you describe that for all kinds of screens the state is preserved and all elements are visible?
<?xml version="1.0" encoding="UTF-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/Table8" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="20dp" > <TableRow android:id="@+id/tableRow1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="-4dp" android:layout_marginBottom="-4dp" > <Button android:id="@+id/button1" style="?android:attr/buttonStyleSmall" android:layout_width="35dp" android:layout_height="35dp" android:layout_marginRight="-4dp" android:layout_marginLeft="-4dp" android:text="" /> <Button android:id="@+id/button2" style="?android:attr/buttonStyleSmall" android:layout_width="35dp" android:layout_height="35dp" android:layout_marginRight="-4dp" android:layout_marginLeft="-4dp" android:text="" /> <Button android:id="@+id/button3" style="?android:attr/buttonStyleSmall" android:layout_width="35dp" android:layout_height="35dp" android:layout_marginRight="-4dp" android:layout_marginLeft="-4dp" android:text="" /> <Button android:id="@+id/button4" style="?android:attr/buttonStyleSmall" android:layout_width="35dp" android:layout_height="35dp" android:layout_marginRight="-4dp" android:layout_marginLeft="-4dp" android:text="" /> <Button android:id="@+id/button5" style="?android:attr/buttonStyleSmall" android:layout_width="35dp" android:layout_height="35dp" android:layout_marginRight="-4dp" android:layout_marginLeft="-4dp" android:text="" /> <Button android:id="@+id/button6" style="?android:attr/buttonStyleSmall" android:layout_width="35dp" android:layout_height="35dp" android:layout_marginRight="-4dp" android:layout_marginLeft="-4dp" android:text="" /> <Button android:id="@+id/button7" style="?android:attr/buttonStyleSmall" android:layout_width="35dp" android:layout_height="35dp" android:layout_marginRight="-4dp" android:layout_marginLeft="-4dp" android:text="" /> <Button android:id="@+id/button8" style="?android:attr/buttonStyleSmall" android:layout_width="35dp" android:layout_height="35dp" android:layout_marginRight="-4dp" android:layout_marginLeft="-4dp" android:text="" /> </TableRow>
Here is one of the lines.