title: Android: wrap GridView in a dialog
body: <p>Does anyone know how to wrap a GridView? </p>
  
  <p>Despite setting layout_width to wrap_content both on the GridView and parent LinearLayout the GridView is still bigger than its 3 column content (approx. double the content width). Tried also to apply fixed layout_width = ... dp. That did not work either.</p>
  
  <p>Any ideas how to wrap the GridView? See below.</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"   
            android:id="@+id/layout_root"   
            android:orientation="vertical"   
            android:layout_width="wrap_content"   
            android:layout_height="wrap_content"   
            android:padding="10dp" &gt;
  
      &lt;GridView xmlns:android="http://schemas.android.com/apk/res/android"    
          android:id="@+id/gridview"   
          android:layout_width="wrap_content"   
          android:layout_height="wrap_content"   
          android:columnWidth="90dp"   
          android:numColumns="3"   
          android:verticalSpacing="10dp"   
          android:horizontalSpacing="10dp"   
          android:stretchMode="none"   
          android:gravity="center" /&gt;
  
  &lt;/LinearLayout&gt;   
  </code></pre>