title: Android: how to center view within column of TableLayout?
body: <p>I am trying to create a TabeLayout with a grid of CheckBoxes.  Across the top are 2 headers, and each additional row consists of a label and 2 CheckBoxes.  I would like the table to fill all available space, the first column to be oriented to the left, and the CheckBoxes and their headers to be centered within their columns.  In the below layout, the headers appear centered properly, but the CheckBoxes are not.  I added a background color to one of the CheckBoxes, this demonstrates that the CheckBox actually grew to fill its column (which is why it won't center as desired); despite the "wrap_content" layout param. </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center_horizontal"
      android:orientation="vertical"&gt;
      &lt;TableLayout 
          android:stretchColumns="1,2"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"&gt;
  
          &lt;TableRow&gt;
              &lt;TextView 
                  android:text="" 
                  android:gravity="center_horizontal"
                  android:layout_width="wrap_content" 
                  android:layout_height="wrap_content"&gt;
              &lt;/TextView&gt;
              &lt;TextView 
                  android:text="First category" 
                  android:gravity="center_horizontal"
                  android:layout_width="wrap_content" 
                  android:layout_height="wrap_content"&gt;
              &lt;/TextView&gt;
              &lt;TextView 
                  android:text="2nd category" 
                  android:gravity="center_horizontal"
                  android:layout_width="wrap_content" 
                  android:layout_height="wrap_content"&gt;
              &lt;/TextView&gt;
          &lt;/TableRow&gt;
          &lt;TableRow&gt;
              &lt;TextView 
                  android:text="Row 1: " 
                  android:layout_width="wrap_content" 
                  android:layout_height="wrap_content"&gt;
              &lt;/TextView&gt;
              &lt;CheckBox
                  android:background="#FF001122"
                  android:layout_height="50dip"
                  android:layout_width="wrap_content" 
                  android:gravity="center_horizontal"&gt;
              &lt;/CheckBox&gt;
              &lt;CheckBox
                  android:layout_height="50dip"
                  android:layout_width="wrap_content" 
                  android:gravity="center_horizontal"&gt;
              &lt;/CheckBox&gt;
          &lt;/TableRow&gt;
      &lt;/TableLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/w5CVB.png" alt="enter image description here"></p>