title: RecyclerView item width layout_width=“match_parent” does not match parent
body: <p>I'm using RecyclerView and I'm trying to make the width item of RecyclerView match_parent since I'm using </p>
  
  <blockquote>
    <p>LinearLayoutManager.HORIZONTAL</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/4ulwK.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/4ulwK.jpg" alt="RecyclerView items after running"></a></p>
  
  <pre><code> &lt;android.support.v7.widget.RecyclerView
              android:id="@+id/listOffersHits"
              android:layout_width="match_parent"
              android:layout_height="match_parent" /&gt;
  </code></pre>
  
  <p>custom_layout.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:card_view="http://schemas.android.com/apk/res-auto"
      android:id="@+id/card_view"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_gravity="center"
      android:layout_weight="1"
      android:layout_margin="2dp"
      card_view:cardCornerRadius="2dp"&gt;
      &lt;ImageView
          android:id="@+id/offerImage"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
  
          android:background="@drawable/item_selector"
          android:scaleType="fitXY"
          android:src="@drawable/offer"
          /&gt;
  
  &lt;/android.support.v7.widget.CardView&gt;
  </code></pre>
  
  <p>LayoutManager</p>
  
  <pre><code>   LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity(),LinearLayoutManager.HORIZONTAL, false);
      listOffersHits.setLayoutManager(linearLayoutManager);
  </code></pre>
  
  <p>ViewHolder</p>
  
  <pre><code>View view= LayoutInflater.from(parent.getContext())
                  .inflate(R.layout.custom_layout, parent, false);
          ViewOffersHolder viewHolder=new ViewOffersHolder(view);
          return viewHolder;
  </code></pre>