I'm trying to make my Recycler view to not take all the screen space when there are just a few items on it using wrap_content
, but that doesn't seem to work. What's the problem?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_height="match_parent"
android:layout_width="fill_parent"
android:gravity="center_horizontal"
android:weightSum="1">
<android.support.v7.widget.RecyclerView
android:id="@+id/smoke_recycler_view"
android:scrollbars="vertical"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:paddingTop="4dp"
android:paddingRight="4dp"
android:paddingLeft="4dp"
android:layout_marginTop="25dp"
android:layout_marginBottom="25dp"
android:background="#FFF"
android:elevation="2dp" />
</LinearLayout>
</RelativeLayout>