Ich möchte zwei Listenansicht mit meiner unteren Funktionalität in einem Layout verwenden. Hier ist meine Layoutdatei. Ich möchte nur, wenn mein Eltern Layout füllen Loch Bildschirm dann Kind kommt nach Eltern Layout und ich möchte auch zeigen meine unteren Layout, wie es ist. Bitte hilf mir, das zu lösen. Danke :)Wie kann ich zwei Listenansicht mit Schaltfläche unten verwenden
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
xmlns:android="http://schemas.android.com/apk/res/android">
<ListView
android:id="@+id/my_cart_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<ListView
android:id="@+id/my_ecart_list"
android:layout_below="@+id/my_cart_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/rr"
android:layout_weight="1"/>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/rr"
android:background="#FA0"
android:layout_marginBottom="0dp">
<TextView
android:id="@+id/item_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Items"
android:textColor="#000"
android:textSize="17sp"
android:layout_marginTop="15dp"
android:layout_marginLeft="20dp"/>
<TextView
android:id="@+id/cart_item_count"
android:layout_toRightOf="@+id/item_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="(2)"
android:textColor="#000"
android:textSize="17sp"
android:layout_marginTop="15dp"
android:layout_marginLeft="5dp"/>
<TextView
android:id="@+id/total_cart_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000"
android:textSize="20sp"
android:layout_alignTop="@+id/cart_item_count"
android:layout_centerHorizontal="true" />
<Button
android:id="@+id/checkout_cart"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="4dp"
android:layout_marginTop="4dp"
android:padding="3dp"
android:text="Checkout >>"
android:textSize="16dp" />
<TextView
android:id="@+id/mycart_empty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="CART IS EMPTY"
android:gravity="center"
android:textColor="#000"
android:textSize="22sp"
android:layout_marginTop="12dp"/>
</RelativeLayout>
</RelativeLayout>
Verwenden Sie das Layoutgewicht-Konzept, ODER geben Sie Listview eine feste Höhe. –
Ich werde Layout-Gewicht verwenden, aber mein zweites Layout wird nicht nach dem ersten kommen .. und ich möchte, dass alle Layout über dem Kind relativ Layout. –
Bitte besuchen Sie diese [link] (http://stackoverflow.com/a/28713754/2078074). Hoffe, es wird dir helfen. – Lawrance