我正在制作新闻应用程序,或者没有。我有与CardViews RecyclerView。当我启动它时,每张卡片都会粘在其他卡片上,因此看起来像一张大卡片。我怎样才能分开它?RecyclerView物品互相粘在一起
卡:
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fresco="http://schemas.android.com/apk/res-auto"
android:id="@+id/cv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">
<com.facebook.drawee.view.SimpleDraweeView
fresco:placeholderImage="@drawable/my_drawable"
android:id="@+id/markPhoto"
android:layout_width="130dp"
android:layout_height="130dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginRight="16dp" />
<TextView
android:id="@+id/x"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/markPhoto" />
<TextView
android:id="@+id/y"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/x"
android:layout_toRightOf="@+id/markPhoto" />
</RelativeLayout>
</android.support.v7.widget.CardView>
RecyclerView:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v7.widget.RecyclerView>
</LinearLayout>
ty,它有帮助。为RelativeLayout添加保证金没有解决问题,但CardView halped。非常感谢 –
很高兴我能帮上忙! – drawinfinity