Ich habe hier ein einfaches Layout, aber das LinearLayout in ScrollView stimmt nicht mit der übergeordneten Höhe überein.Höhe des untergeordneten Layouts entspricht nicht dem übergeordneten Layout
<LinearLayout
.
.
android:layout_width = "match_parent"
android:layout_height = "match_parent"
android:orientation = "vertical"
.
.>
<EditText
.
./>
<Button
.
./>
<ScrollView
android:layout_width = "match_parent"
android:layout_height = "match_parent">
<LinearLayout
android:id = "@+id/layoutWeb"
android:layout_width = "match_parent"
android:layout_height = "match_parent"
android:orientation = "vertical">
<ListView
android:id = "@+id/listWeb"
android:layout_width = "match_parent"
android:layout_height = "match_parent">
</ListView>
</LinearLayout>
</ScrollView>
</LinearLayout>
Die ID schlägt vor, die Höhe des linearen Layouts (id = layoutWeb) in wrap_parent zu ändern. Ich habe das lineare Layout in der Abbildung unten gewählt, aber seine Höhe ist die Mutter
Nie ListView in ScrollView, und das erste LinearLayout enthält keine Polsterung? –
Ich habe gerade festgestellt, dass das so dumm war. Aber warum sollte es nicht funktionieren? –
match_parent funktioniert nicht im ScrollView-Stammverzeichnis. Auch solltest du neuere Scrolls in andere ScrollViews einfügen (ListView in ScrollView). –