Ich versuche ein relatives Layout für mein Schulprojekt zu erstellen. Das mittlere Element verweigert die gleiche Höhe und Entfernung von oben wie die anderen. Wie behebe ich das?Warum sieht mein relatives Format peinlich aus?
Bearbeiten: Um die Symbole zu verdeutlichen sind TextViews mit fontAwesome. Debugging ein wenig Ich wechselte die Symbole der linken und mittleren Container und das Zentrum war immer noch höher, ich glaube, es ist ein Problem der Formatierung.
Layout:
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:orientation="vertical"
android:paddingTop="10dp">
<TextView
android:id="@+id/icDate"
android:textAppearance="@color/colorPrimaryDark"
android:text="@string/fa_calender"
android:textSize="24sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center">
</TextView>
<TextView
android:textAppearance="@color/colorPrimaryDark"
android:id="@+id/tvDate"
android:textSize="14sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center">
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="vertical"
android:paddingTop="10dp">
<TextView
android:id="@+id/icDuration"
android:textAppearance="@color/colorPrimaryDark"
android:text="@string/fa_time"
android:textSize="24sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center">
</TextView>
<TextView
android:textAppearance="@color/colorPrimaryDark"
android:id="@+id/tvDuration"
android:textSize="14sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center">
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:orientation="vertical"
android:paddingTop="10dp">
<TextView
android:id="@+id/icDistance"
android:textAppearance="@color/colorPrimaryDark"
android:text="@string/fa_road"
android:textSize="24sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center">
</TextView>
<TextView
android:textAppearance="@color/colorPrimaryDark"
android:id="@+id/tvDistance"
android:textSize="14sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center">
</TextView>
</LinearLayout>
</RelativeLayout>
mit bg Problem markieren:
ohne bg
Vielleicht ist die Größe des Bildes anders? –