title: How to center horizontal recyclerview in center?
body: <p>How can I make horizontal recyclerview in the center?</p>
  <p>I have tried many ways putting <code>android:layout_gravity=&quot;center&quot;</code> in recyclerView or putting recyclerview in linear layout.</p>
  <p>But I didn't succeed.</p>
  <p>This is my code.</p>
  <p>This is xml file which contains my recyclerview.</p>
  <pre><code>    &lt;LinearLayout
             android:layout_width=&quot;match_parent&quot;
             android:layout_height=&quot;match_parent&quot;
             android:orientation=&quot;horizontal&quot;&gt;
     
         &lt;android.support.v7.widget.RecyclerView
             android:layout_width=&quot;wrap_content&quot;
             android:layout_height=&quot;40dp&quot;
             android:visibility=&quot;invisible&quot;
             android:layout_gravity=&quot;center_horizontal&quot;
             android:layout_marginTop=&quot;-20dp&quot;
             android:id=&quot;@+id/recycler_view&quot;&gt;
         &lt;/android.support.v7.widget.RecyclerView&gt;
     
     &lt;/LinearLayout&gt;
  </code></pre>
  <p><strong>item_row.xml file</strong></p>
  <pre><code>    &lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
          android:orientation=&quot;horizontal&quot; android:layout_width=&quot;wrap_content&quot;
          android:layout_gravity=&quot;center&quot;
          android:layout_height=&quot;match_parent&quot;&gt;
      
          &lt;TextView
              android:layout_width=&quot;30dp&quot;
              android:layout_height=&quot;match_parent&quot;
              android:id=&quot;@+id/textview_size&quot;
              android:background=&quot;@drawable/textview_border&quot;
              android:gravity=&quot;center&quot;
              android:textColor=&quot;#000000&quot;
              /&gt;
      
      &lt;/LinearLayout&gt;
  </code></pre>