Im Gebäude dieser App, will nur diese Tasten gleichmäßig auf dem Bildschirm verteilen, ist dies der Code i`m mit:Android-Layout Gewicht funktioniert nicht
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/tera_mt_serv"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:onClick="teraServerBt"
android:background="@color/gblue"
android:textColor="#fff"
android:text="@string/tera_server_st_mt_ab"
android:textAlignment="center"
android:textAllCaps="true"
android:layout_weight="1"
tools:ignore="ButtonStyle" />
<Button
android:id="@+id/tera_ff_serv"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@color/gblue"
android:textColor="#fff"
android:text="@string/tera_server_st_ff_ab"
android:textAlignment="center"
android:textAllCaps="true"
android:layout_weight="1"
tools:ignore="ButtonStyle" />
<Button
android:id="@+id/tera_ch_serv"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@color/gblue"
android:textColor="#fff"
android:onClick="teraServerBt"
android:text="@string/tera_server_st_ch_ab"
android:textAlignment="center"
android:textAllCaps="true"
android:layout_weight="1"
tools:ignore="ButtonStyle" />
<Button
android:id="@+id/tera_av_serv"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@color/gblue"
android:textColor="#fff"
android:text="@string/tera_server_st_av_ab"
android:textAlignment="center"
android:textAllCaps="true"
android:layout_weight="1"
tools:ignore="ButtonStyle" />
<Button
android:id="@+id/tera_tr_serv"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@color/gblue"
android:textColor="#fff"
android:text="@string/tera_server_st_tr_ab"
android:textAlignment="center"
android:textAllCaps="true"
android:layout_weight="1"
tools:ignore="ButtonStyle" />
Aber ich habe immer noch diese Ergebnis, auch wenn ich testen sie es auf meinem Handy:
Im neu auf diese so muss es etwas einfacher sein, dass ich kann leider nicht sehen. Wie auch immer, Danke im Voraus für jede Hilfe!
Scheint Ihre Ansicht nicht die volle Breite einnimmt. Verwenden Sie match_parent width für root view – Rahul