title: Center GridView in Relative layout
body: <p>I have simple layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout 
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  
  &lt;GridView
      android:id="@+id/photo_browser_grid_view"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_centerInParent="true"
      android:gravity="center"
      android:horizontalSpacing="5dp"
      android:verticalSpacing="5dp"
      android:stretchMode="none"
      android:numColumns="auto_fit" 
      android:columnWidth="100dp"&gt;
  &lt;/GridView&gt;
  </code></pre>
  
  <p></p>
  
  <p>I want to centre my GridView inside Relative layout. My spacing is always fixed. In result I have GridView aligned to left. How can I center it inside parent?</p>
  
  <p><img src="https://i.stack.imgur.com/ZGiUk.png" alt="GridView"></p>