title: Android: Cannot center my GridLayout
body: <p>I want to display a grid of buttons 15 buttons, 3 columns and 5 rows.
  They should be centered horizontally and vertically with equal spacing between them in the same direction (meaning same space horizontally between all buttons but could have another space vertically as long as the space vertically is the same).</p>
  
  <p>Here is what it looks like now (not at all what I want):
  <a href="http://sv.tinypic.com/view.php?pic=dbgjll&amp;s=8#.U-ELkNbzTFY" rel="nofollow">http://sv.tinypic.com/view.php?pic=dbgjll&amp;s=8#.U-ELkNbzTFY</a></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/choose_level_grid_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_gravity="center"
      android:background="@drawable/wood_background"
      android:columnCount="3"
      android:horizontalSpacing="60dp"
      android:verticalSpacing="60dp" &gt;
  
      &lt;Button
          android:id="@+id/level1_button"
          android:layout_width="@dimen/choose_level_button_width"
          android:layout_height="@dimen/choose_level_button_height"
          android:background="@drawable/main_menu_button_shape"
          android:padding="@dimen/main_menu_button_padding"
          android:text="@string/level1_btn_text"
          android:textColor="@color/textcolor_on_transparent_brown"
          android:textSize="@dimen/choose_level_text_size" /&gt;
  
      &lt;Button
          android:id="@+id/level2_button"
          android:background="@drawable/main_menu_button_shape"
          android:padding="@dimen/main_menu_button_padding"
          android:textColor="@color/textcolor_on_transparent_brown"
          android:textSize="@dimen/choose_level_text_size"
          android:text="@string/level2_btn_text"
          android:layout_height="@dimen/choose_level_button_height"
          android:layout_width="@dimen/choose_level_button_width"
      /&gt;
  
      &lt;Button
          android:id="@+id/level3_button"
          android:background="@drawable/main_menu_button_shape"
          android:padding="@dimen/main_menu_button_padding"
          android:textColor="@color/textcolor_on_transparent_brown"
          android:textSize="@dimen/choose_level_text_size"
          android:text="@string/level3_btn_text"
          android:layout_height="@dimen/choose_level_button_height"
          android:layout_width="@dimen/choose_level_button_width"
      /&gt;
  
      &lt;Button
          android:id="@+id/level4_button"
          android:background="@drawable/main_menu_button_shape"
          android:padding="@dimen/main_menu_button_padding"
          android:textColor="@color/textcolor_on_transparent_brown"
          android:textSize="@dimen/choose_level_text_size"
          android:text="@string/level4_btn_text"
          android:layout_height="@dimen/choose_level_button_height"
          android:layout_width="@dimen/choose_level_button_width"
      /&gt;
  
      &lt;Button
          android:id="@+id/level5_button"
          android:background="@drawable/main_menu_button_shape"
          android:padding="@dimen/main_menu_button_padding"
          android:textColor="@color/textcolor_on_transparent_brown"
          android:textSize="@dimen/choose_level_text_size"
          android:text="@string/level5_btn_text"
          android:layout_height="@dimen/choose_level_button_height"
          android:layout_width="@dimen/choose_level_button_width"
      /&gt;
  
      &lt;Button
          android:id="@+id/level6_button"
          android:background="@drawable/main_menu_button_shape"
          android:padding="@dimen/main_menu_button_padding"
          android:textColor="@color/textcolor_on_transparent_brown"
          android:textSize="@dimen/choose_level_text_size"
          android:text="@string/level6_btn_text"
          android:layout_height="@dimen/choose_level_button_height"
          android:layout_width="@dimen/choose_level_button_width"
      /&gt;
  
      &lt;Button
          android:id="@+id/level7_button"
          android:background="@drawable/main_menu_button_shape"
          android:padding="@dimen/main_menu_button_padding"
          android:textColor="@color/textcolor_on_transparent_brown"
          android:textSize="@dimen/choose_level_text_size"
          android:text="@string/level7_btn_text"
          android:layout_height="@dimen/choose_level_button_height"
          android:layout_width="@dimen/choose_level_button_width"
      /&gt;
  
      &lt;Button
          android:id="@+id/level8_button"
          android:background="@drawable/main_menu_button_shape"
          android:padding="@dimen/main_menu_button_padding"
          android:textColor="@color/textcolor_on_transparent_brown"
          android:textSize="@dimen/choose_level_text_size"
          android:text="@string/level8_btn_text"
          android:layout_height="@dimen/choose_level_button_height"
          android:layout_width="@dimen/choose_level_button_width"
      /&gt;
  
      &lt;Button
          android:id="@+id/level9_button"
          android:background="@drawable/main_menu_button_shape"
          android:padding="@dimen/main_menu_button_padding"
          android:textColor="@color/textcolor_on_transparent_brown"
          android:textSize="@dimen/choose_level_text_size"
          android:text="@string/level9_btn_text"
          android:layout_height="@dimen/choose_level_button_height"
          android:layout_width="@dimen/choose_level_button_width"
      /&gt;
  
      &lt;Button
          android:id="@+id/level10_button"
          android:background="@drawable/main_menu_button_shape"
          android:padding="@dimen/main_menu_button_padding"
          android:textColor="@color/textcolor_on_transparent_brown"
          android:textSize="@dimen/choose_level_text_size"
          android:text="@string/level10_btn_text"
          android:layout_height="@dimen/choose_level_button_height"
          android:layout_width="@dimen/choose_level_button_width"
      /&gt;
  
      &lt;Button
          android:id="@+id/level11_button"
          android:background="@drawable/main_menu_button_shape"
          android:padding="@dimen/main_menu_button_padding"
          android:textColor="@color/textcolor_on_transparent_brown"
          android:textSize="@dimen/choose_level_text_size"
          android:text="@string/level11_btn_text"
          android:layout_height="@dimen/choose_level_button_height"
          android:layout_width="@dimen/choose_level_button_width"
      /&gt;
  
      &lt;Button
          android:id="@+id/level12_button"
          android:background="@drawable/main_menu_button_shape"
          android:padding="@dimen/main_menu_button_padding"
          android:textColor="@color/textcolor_on_transparent_brown"
          android:textSize="@dimen/choose_level_text_size"
          android:text="@string/level12_btn_text"
          android:layout_height="@dimen/choose_level_button_height"
          android:layout_width="@dimen/choose_level_button_width"
      /&gt;
  
      &lt;Button
          android:id="@+id/level13_button"
          android:background="@drawable/main_menu_button_shape"
          android:padding="@dimen/main_menu_button_padding"
          android:textColor="@color/textcolor_on_transparent_brown"
          android:textSize="@dimen/choose_level_text_size"
          android:text="@string/level13_btn_text"
          android:layout_height="@dimen/choose_level_button_height"
          android:layout_width="@dimen/choose_level_button_width"
      /&gt;
  
      &lt;Button
          android:id="@+id/level14_button"
          android:background="@drawable/main_menu_button_shape"
          android:padding="@dimen/main_menu_button_padding"
          android:textColor="@color/textcolor_on_transparent_brown"
          android:textSize="@dimen/choose_level_text_size"
          android:text="@string/level14_btn_text"
          android:layout_height="@dimen/choose_level_button_height"
          android:layout_width="@dimen/choose_level_button_width"
      /&gt;
  
      &lt;Button
          android:id="@+id/level15_button"
          android:background="@drawable/main_menu_button_shape"
          android:padding="@dimen/main_menu_button_padding"
          android:textColor="@color/textcolor_on_transparent_brown"
          android:textSize="@dimen/choose_level_text_size"
          android:text="@string/level15_btn_text"
          android:layout_height="@dimen/choose_level_button_height"
          android:layout_width="@dimen/choose_level_button_width"
      /&gt;
  
  &lt;/GridLayout&gt;
  </code></pre>