Ich habe ein GridLayout und darin sind 6 LinearLayout Kinder. Darin sind Knöpfe und andere Dinge.GridLayout nicht gleichmäßig Abstand Kinder im gesamten Bildschirm
In Android Studio sieht es gut aus, aber auf einem tatsächlichen Gerät (und sogar Emulator) es nicht gleichmäßig Platz. Hier ist ein Bild von dem, was passiert.
<RelativeLayout <!--main layout stuff-->
>
<GridLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:rowCount="4"
android:columnCount="2">
<!--
there are six of these inside the grid layout
-->
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_columnWeight="1"
android:layout_rowWeight="1">
<ImageButton
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/button"
android:src="@drawable/button"
android:layout_gravity="center"/>
</LinearLayout>
</GridLayout>
</RelativeLayout>
in welchem Gerät testen Sie? –
HTC One Mini, Samsung und Emulator –
Ich empfehle Ihnen, Gridview benutzerdefinierte –