Ich bin relativ neu in Android und frage mich, ob es eine bessere Möglichkeit gibt, dieses Layout zu tun. Ich brauche 4 Etiketten, die auf der linken Seite vertikal gestapelt sind, mit 2 größeren Schriften auf der rechten Seite. Wenn Sie das im Emulator ausführen, ist es genau so, wie ich es brauche, aber gibt es einen bevorzugten Weg?Android - Gibt es eine bessere Möglichkeit, dieses Layout zu erstellen?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/Label1"
android:text="Label 1: "
android:layout_width="200dp"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/Label2"
android:text="Label 2: "
android:layout_below="@id/Label1"
android:layout_width="200dp"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/Label3"
android:text="Label 3: "
android:layout_below="@id/Label2"
android:layout_width="200dp"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/Label4"
android:text="Label 4: "
android:layout_below="@id/Label3"
android:layout_width="200dp"
android:layout_height="wrap_content"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toRightOf="@id/Label1">
<TextView
android:id="@+id/Label6"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Points"
android:textStyle="bold"
android:textSize="25sp"
android:gravity="center_horizontal"/>
<TextView
android:id="@+id/LabelPoints"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="8.6"
android:textStyle="bold"
android:textSize="25sp"
android:gravity="center_horizontal"/>
</LinearLayout>
</RelativeLayout>
Es wird für kleine Fälle in Ordnung sein - es ist nicht so, als ob er aus LinearLayouts eine Tabellenstruktur zeichnet – ataulm