大家好,
我正在尝试删除我的recyclerview中卡片视图项之间的额外空格,以下是当前输出。请给予建议。
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#303030"
android:id="@+id/cv"
android:layout_marginTop="2dip"
android:layout_marginBottom="2dip"
card_view:cardUseCompatPadding="true"
card_view:cardElevation="5dp"
android:foreground="?android:attr/selectableItemBackground"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:padding="5dp"
android:longClickable="true"
android:background="#303030">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/person_photo"
android:background="@drawable/vector_red"
android:layout_alignBottom="@+id/txtSub" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="@+id/txtMain"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/person_photo"
android:layout_toEndOf="@+id/person_photo"
android:elevation="4dp"
android:textSize="20dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Small Text"
android:id="@+id/txtSub"
android:layout_below="@+id/txtMain"
android:layout_toRightOf="@+id/person_photo"
android:layout_toEndOf="@+id/person_photo" />
</RelativeLayout>
</android.support.v7.widget.CardView>
我的回收站视图
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".HomeFragment">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
card_view:cardUseCompatPadding="false"
card_view:cardPreventCornerOverlap="false"
android:background="#0fffffff" />
</RelativeLayout>