Ich mache eine Listenansicht in Android, und meine Listview füllt nicht den gesamten Bildschirm. Es hat noch ein wenig Platz unterhalb der Listenansicht (wahrscheinlich, weil ich nicht genug Elemente habe, um den Bildschirm zu füllen). Ich habe online nach vielen Lösungen gesucht, aber keine scheint in der Lage zu sein, dieses Problem zu lösen.Wie kann ich zulassen, dass mein ListView den gesamten Bildschirm in Android ausfüllt?
Hier ist mein Layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.ListActivity">
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id = "@+id/customListview">
</ListView>
</LinearLayout>
Hier mein item_layout.xml ist:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id= "@+id/ItemNameSales"
android:layout_alignParentLeft="true"
android:text="Item Name"
android:textAppearance="?android:attr/textAppearanceLarge"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id= "@+id/ItemNameQty"
android:layout_alignParentRight="true"
android:text="Item Quantity"
android:textAppearance="?android:attr/textAppearanceLarge"/>
</RelativeLayout>
zeigen Sie Ihren Adapter Artikel xml Ansicht pls –
@VladislavShcherbakov getan! Bitte sehen Sie sich um! :) – Shells
und R.layout.item_layout xml pls –