title: android How to stretch rows in the gridview to fill screen?
body: <p>I have simple GridView (with one column and six rows), that displays ImageView with TextView in the cell (I create adapter). How to stretch rows to fill entire screen height?? Now I have some space below cells... </p>
  
  <p>main.xml</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent" 
  android:layout_height="fill_parent"
  android:orientation="horizontal"&gt;
  &lt;LinearLayout android:layout_height="fill_parent"
      android:layout_width="150dp" 
      android:orientation="vertical"
      android:id="@+id/left"&gt;
      &lt;include layout="@layout/menu_grid"&gt;&lt;/include&gt;
  &lt;/LinearLayout&gt;
  &lt;LinearLayout android:layout_height="fill_parent"
      android:layout_width="fill_parent" 
      android:orientation="vertical"
      android:id="@+id/right"&gt;
      &lt;ImageView android:src="@drawable/image"
          android:layout_height="wrap_content" 
          android:layout_width="wrap_content"
          android:id="@+id/imageMain" 
          android:layout_gravity="center"&gt;
      &lt;/ImageView&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>menu_grid.xml</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent" android:layout_height="fill_parent"&gt;
  &lt;GridView android:layout_height="wrap_content"
      android:layout_width="fill_parent" 
      android:id="@+id/gridView"
      android:padding="10dp" 
      android:verticalSpacing="10dp"
      android:horizontalSpacing="10dp" 
      android:numColumns="1"
      android:columnWidth="100dp" 
      android:stretchMode="columnWidth"
      android:gravity="center"&gt;&lt;/GridView&gt;
  </code></pre>
  
  <p></p>
  
  <p>item.xml</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="wrap_content" android:layout_height="wrap_content"
  android:orientation="vertical" android:gravity="fill_horizontal"&gt;
  &lt;ImageView android:src="@drawable/icon"
      android:layout_height="70dp" android:id="@+id/imageIcon"
      android:layout_width="70dp" android:layout_gravity="center_horizontal"&gt;&lt;/ImageView&gt;
  &lt;TextView android:id="@+id/textIcon" android:text="TextView"
      android:layout_gravity="center" android:layout_height="wrap_content"
      android:layout_width="wrap_content"&gt;&lt;/TextView&gt;
  </code></pre>
  
  <p></p>
  
  <p>ImageAdapter.java</p>
  
  <pre><code>public class ImageAdapter extends BaseAdapter {
  //....some code
  //....
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
      View view;
      if (convertView == null) {  
          LayoutInflater inflater = (LayoutInflater)_context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          view = inflater.inflate(R.layout.item, null);
  
          TextView text = (TextView) view.findViewById(R.id.textIcon);
          text.setText(labels[position]);
  
          ImageView image = (ImageView) view.findViewById(R.id.imageIcon);
          image.setImageResource(icons[position]);        
  
      } else {
          view = convertView;
      }
  
      return view;
  }
  </code></pre>
  
  <p>}</p>