Ich versuche, diesen Code zu verwenden, aber es funktioniert nicht, wenn ich Layout-Gewicht. Wenn ich Layout-Gewicht entfernen und Höhe für die Bildansicht eingeben, funktioniert es gut.layout_weight funktioniert nicht in Bildlaufansicht
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="10">
<ImageView
android:id="@+id/informative_image_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3.7"
android:scaleType="fitXY"></ImageView>
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view_option_menu"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="6.3" />
</LinearLayout>
</ScrollView>
Der Grund, warum er height == 0 ist, weil die Ausrichtung vertikal ist – Eenvincible
Das Kind eines ScrollView sollte auch Höhe wrap_content haben – Eenvincible
was möchten Sie erreichen? Was ist das erwartete Ergebnis, das Sie sehen möchten? – Gunhan