Ich habe versucht, zwei ImageView vertikal in einem RelativeLayout anzuzeigen, jedes ImageView hat 50% als Gewicht, aber die Anzeige nur ein ImageView wird angezeigt.Warum layout_weight funktioniert nicht korrekt in RelativeLayout?
Code:
<RelativeLayout
android:id="@+id/layout_board"
android:layout_width="match_parent"
android:layout_height="450dp"
android:background="@color/colorPrimaryDark"
android:weightSum="2">
<ImageView android:id="@+id/imageView11"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/colorAccent"
android:adjustViewBounds="true"
android:scaleType="fitXY"/>
<ImageView android:id="@+id/imageView21"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/colorAccent"
android:adjustViewBounds="true"
android:scaleType="fitXY"/>
</RelativeLayout>
Bitte um Hilfe!
'layout_weight' funktioniert nur mit' LinearLayout'. –