title: How to set GridView row height?
body: <p>I have a <code>GridView</code>, and setting the number of columns and the overal width of the grid layout. Need items with <code>66dp</code> x <code>66dp</code> size. But somehow items  are squared, but smaller the 66x66. What am I forget? </p>
  
  <pre><code>int zz = .. // number of columns comes from outside
  gridview.setNumColumns(zz);
  LinearLayout.LayoutParams linearParams = (LinearLayout.LayoutParams)gridview.getLayoutParams();
  linearParams.width=66*zz;
  gridview.setLayoutParams(linearParams);
  </code></pre>
  
  <hr>
  
  <pre><code>&lt;GridView
                  android:id="@+id/gridView1"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:layout_margin="0dp"
                  android:columnWidth="66dp"
                  android:gravity="center"
                  android:horizontalSpacing="0dp"
                  android:scrollbarAlwaysDrawHorizontalTrack="true"
                  android:scrollbarAlwaysDrawVerticalTrack="true"
                  android:scrollbars="horizontal"
                  android:stretchMode="none"
                  android:verticalSpacing="0dp"&gt;
  
              &lt;/GridView&gt;
  </code></pre>
  
  <hr>
  
  <p>item prototype</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="66dp" android:layout_height="66dp"&gt;
  
      &lt;ImageView
          android:id="@+id/icon"
          android:layout_width="66dp"
          android:layout_height="66dp"
          android:padding="0dp"
          android:background="@android:color/holo_orange_light"/&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <hr>
  
  <p>shreen shot</p>
  
  <p><a href="https://i.stack.imgur.com/DiDK0.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DiDK0.jpg" alt="enter image description here"></a></p>