title: Android Grid view with 3 rows and 3 columns
body: <p>I unable to set no. of rows for <strong>grid view</strong>. Only able to set no. of columns. </p>
  
  <p>I need to create a grid view which has 3 rows and 3 columns. </p>
  
  <p>Can any one help me please.</p>
  
  <p>This is my <code>XML</code> layout code:</p>
  
  <pre><code>&lt;GridView android:id="@+id/gridView" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:numColumns="3" 
     android:gravity="center" 
     android:stretchMode="columnWidth" &gt; 
  &lt;/GridView&gt;
  </code></pre>
  
  <p>Thanks in advance,
  Deepak</p>