Я использовал адаптер списка, внутри которого я пытался использовать вид карты. Но он занимает слишком много места между двумя последовательными картами - PullRequest
0 голосов
/ 27 апреля 2020

Я использовал адаптер списка, внутри которого я пытался использовать вид карты. Но он занимает слишком много места между двумя последовательными картами. Ниже приведен список list_view_adapter. xml код. Я взял линейный макет, внутри которого я использовал вид карты. Я также принял высоту внешнего линейного макета как wrap_content, но все же он занимает дополнительное пространство между двумя картами, как показано на рисунке ниже.

 <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:orientation="vertical"
        android:background="@drawable/bpg"
        android:layout_marginBottom="-69dp">


        <androidx.cardview.widget.CardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:cardElevation="12dp"
            app:cardCornerRadius="15dp"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="10dp"
            app:cardBackgroundColor="#FFFFE0">


            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/ename"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="TextView"
                    android:layout_marginLeft="10dp"
                    android:layout_marginRight="10dp"
                    android:layout_marginTop="20dp"/>

                <TextView
                    android:id="@+id/edesc"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="TextView"
                    android:layout_marginTop="10dp"
                    android:layout_marginLeft="10dp"
                    android:layout_marginRight="10dp"/>

                <TextView
                    android:id="@+id/pocname"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="TextView"
                    android:layout_marginLeft="10dp"
                    android:layout_marginTop="10dp"
                    android:layout_marginRight="10dp"/>

                <TextView
                    android:id="@+id/pocmob"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="TextView"
                    android:layout_marginLeft="10dp"
                    android:layout_marginTop="10dp"
                    android:layout_marginRight="10dp"/>
                <TextView

                    android:id="@+id/pocemail"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:layout_marginLeft="10dp"
                    android:text="TextView"
                    android:layout_marginRight="10dp"/>

                <TextView
                    android:id="@+id/date"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:layout_marginLeft="10dp"
                    android:text="TextView"
                    android:layout_marginRight="10dp"/>

                <TextView
                    android:id="@+id/location"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:layout_marginLeft="10dp"
                    android:text="TextView"
                    android:layout_marginRight="10dp"/>

                <TextView
                    android:id="@+id/time"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:layout_marginLeft="10dp"
                    android:text="TextView"
                    android:layout_marginRight="10dp"/>

                <TextView
                    android:id="@+id/fee"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:layout_marginLeft="10dp"
                    android:text="TextView"
                    android:layout_marginRight="10dp"/>
            </LinearLayout>
        </androidx.cardview.widget.CardView>
    </LinearLayout>



    [enter image description here][1]

    **This is the picture of the output.** 
      [1]: https://i.stack.imgur.com/GREPp.png
...