ich eine TableRow
haben, die durch die Breite des Bildschirms erweitert und innerhalb dieser TableRow
habe ich eine ListView
deren layout_width
ist auf match_parent
, es gibt aber noch nicht durch die Breite des Bildschirms zu erweitern. Es funktionierte richtig, aber seit ich 2 Tasten in der nächsten TableRow
das Problem aufgetreten ist aufgetreten. Ich habe layout_span
Eigenschaft auf 2 gesetzt und funktioniert immer noch nicht. Hier ist meine xmlLayout füllt nicht Mutter
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/saltnpepper">
<TableRow
android:layout_weight="1"
android:gravity="center">
<TextView
android:layout_height="200dp"
android:layout_width="match_parent"
android:background="#FF00FF"
android:layout_span="2"/>
</TableRow>
<TableRow
android:layout_weight="4"
android:layout_marginTop="5dp"
android:background="#FF00FF"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/list1"
android:layout_span="2"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp">
</ListView>
</TableRow>
<TableRow
android:layout_weight="1"
android:gravity="center"
android:layout_width="match_parent">
<Button
android:id="@+id/btnAddToOrder"
android:text="Add To Order"
android:layout_height="wrap_content"
android:layout_width = "match_parent"
android:background="#FF00FF" />
<Button
android:id="@+id/btnProceed"
android:text="Order Now"
android:layout_height="wrap_content"
android:layout_width = "match_parent"
android:background="#FF00FF" />
</TableRow>
</TableLayout>
Ich habe versucht, Hintergrundfarben ändern, damit ich bin sicher, dass das genaue Problem ist mit ListView
nicht die gesamte Breite des Bildschirms während TableRow
(mittlere) erweitert perfekt ist passend auf den Bildschirm
Wo ist Ihr Listenelementlayout? – Rookie