Android recyclerview项目之间的距离

Android recyclerview项目之间的距离,android,android-layout,android-recyclerview,recyclerview-layout,Android,Android Layout,Android Recyclerview,Recyclerview Layout,这就是我的应用程序在RecyclerView中显示项目的方式。 应该是这样的。 我可以做哪些改变来达到同样的效果 <LinearLayout android:layout_width="match_parent" android:layout_height="60dp" android:layout_alignParentBottom="true" android:layout_below="@+id/ln1" android:layout_toRigh

这就是我的应用程序在RecyclerView中显示项目的方式。

应该是这样的。

我可以做哪些改变来达到同样的效果

<LinearLayout android:layout_width="match_parent"
    android:layout_height="60dp"
    android:layout_alignParentBottom="true"
    android:layout_below="@+id/ln1"
    android:layout_toRightOf="@+id/setimage"> 

    <android.support.v7.widget.RecyclerView
        android:id="@+id/horizontal_recycler_view"
        android:layout_width="wrap_content" 
        android:layout_height="50dp" /> 

</LinearLayout>


由于回收视图在方向上是水平的,因此需要将线性布局的
布局宽度
设置为固定值(或
包裹内容
),以删除图像中显示的不需要的空间。

是否可以显示布局xml文件。我猜您使用的是match_parent而不是wrap_内容。谢谢。我尝试了wrapcontent,但它仅解决了50个parent的问题。起初,所有项目都像在所需视图中一样显示,但当我将其向左滑动时,新出现的项目会像以前一样分开。感谢您添加您的RecyclerView布局,但我实际上是在询问适配器的布局。可以将其与适配器类一起作为代码块添加到post中吗。