Screen rotation

The question was asked: 6 years 9 months ago   views: 5
0

I have a TableLayout with a matrix of small buttons 8 on 8 is described using XML. When you rotate the screen some buttons are not visible.
How can you describe that for all types of screens as preserved and all elements 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>

That's one of the lines.

[Auto wrap elements to the next line in Android][1] [1]: /questions/79322/%D0%B0%D0%B2%D1%82%D0%BE%D0%BF%D0%B5%D1%80%D0%B5%D0%BD%D0%BE%D1%81-%D1%8D%D0%BB%D0%B5%D0%BC%D0%B5%D0%BD%D1%82%D0%BE%D0%B2-%D0%BD%D0%B0-%D1%81%D0%BB%D0%B5%D0%B4%D1%83%D1%8E%D1%89%D1%83%D1%8E-%D1%81%D1%82%D1%80%D0%BE%D0%BA%D1%83-%D0%B2-android - sercxjo sercxjo 21-06-2012 в 10:53:17

Answers   1

0

If the layout is designed correctly, the screen rotation should not affect the visibility of some elements.

The cause is likely either that the dimensions of the elements are used either absolute dimensions or not specified weight android:layout_weight, or items not packaged in ScrollView

Answered: Barmaley Barmaley 21-06-2012 в 11:02:00
If not difficult to envision how exactly to add and where to add android:layout_weightnow added CML code. - ramin ramin 21-06-2012 в 11:11:04