title: (android-layout) GridView with Image and Text adds extraspace around Image
body: <p>I want a Gridview with Images and corresponding Text over them. It nearly does work, but there is some extraspace around my images. I first thought the space would be below textview und the imageview, but when removing the text, same space has been there. I read that I would have to add android:adjustViewBounds="true" to my imageview to remove this extraspace, but than my App crashes. Can anyone help me? When does a layout in general crash?</p>
  
  <p>Here is the xml of the griditems</p>
  
  <p>single_grid_item.xml:    </p>
  
  <pre><code>&lt;LinearLayout  xmlns:android="http://schemas.android.com/apk/res/android"            
    android:id = "@+id/single_item_id"          
    android:layout_width="fill_parent"             
    android:layout_height="fill_parent"             
    android:orientation="vertical"
    &gt; 
        &lt;TextView
        android:id = "@+id/image_name"
        android:layout_width = "fill_parent"             
        android:layout_height="wrap_content"
        /&gt;
        &lt;ImageView
        android:id = "@+id/album_image"
        android:adjustViewBounds="true"
        android:layout_width = "fill_parent"             
        android:layout_height="wrap_content"
        /&gt;
  
   &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>This is the XML for the complete Sreenlayout.</p>
  
  <p>home_1.xml:</p>
  
  <pre><code>&lt;RelativeLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical"
    &gt;
    &lt;LinearLayout             
    android:layout_alignParentTop="true"             
    android:layout_width="fill_parent"             
    android:layout_height="fill_parent"             
    android:orientation="vertical"&gt;   
      &lt;GridView
      android:id="@+id/home_1"
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent"
      android:columnWidth="90dp"
      android:numColumns="auto_fit"
      android:verticalSpacing="10dp"
      android:horizontalSpacing="10dp"
      android:stretchMode="columnWidth"
      android:gravity="center"
      /&gt;
      &lt;/LinearLayout&gt; 
      &lt;LinearLayout
          android:id="@+id/home_1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_below="@+id/gridview"
          android:background="#231f20" 
          android:focusable = "true"
      &gt;
  
     &lt;Button
     android:id="@+id/home1searchButton"
     android:text=""
     android:layout_width="50dp"
     android:layout_height="50dp"
     android:background = "@drawable/magnify"
     android:focusable = "true"
     /&gt;
      &lt;Button
     android:id="@+id/home1loadButton"
     android:text=""
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:background = "@drawable/adjustmt"
     android:focusable = "true"
  
     /&gt;
     &lt;Button
     android:id="@+id/home1editButton"
     android:text=""
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:background = "@drawable/assist"
     android:focusable = "true"
     /&gt;
     &lt;Button
     android:id="@+id/home1sendButton"
     android:text=""
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:background = "@drawable/radio"
     android:focusable = "true"
     /&gt;
     &lt;Button
     android:id="@+id/home1folderupButton"
     android:text=""
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:background = "@drawable/folderup"
     android:focusable = "true"
     /&gt;
      &lt;Button
     android:id="@+id/home1newfoldrButton"
     android:text=""
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:background = "@drawable/newfoldr"
     android:focusable = "true"
     /&gt;
      &lt;Button
     android:id="@+id/home1trashButton"
     android:text=""
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:background = "@drawable/trash"
     android:focusable = "true"
     /&gt;
      &lt;Button
     android:id="@+id/home1yesButton"
     android:text=""
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:background = "@drawable/yes"
     android:focusable = "true"
     /&gt;
  
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>For filling the Gridview, I use my ImageAdapter, which extends baseadapter. This is its getVIew Function:</p>
  
  <pre><code>@Override public View getView(int position, View convertView, ViewGroup parent) 
      {
  
          ImageView icon;
          icon = new ImageView(mContext);
  
          LayoutInflater inflater = (LayoutInflater)             mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          View row=inflater.inflate(R.layout.single_griditem, parent, false);
          TextView label=(TextView)row.findViewById(R.id.image_name);
          label.setText(fileNameArray.get(position));
          icon=(ImageView)row.findViewById(R.id.album_image);
  
          icon.setImageBitmap(bmArray.get(position));
  
          return row;
      }
  </code></pre>
  
  <p>And this is my onCreate-Function</p>
  
  <pre><code>     super.onCreate(savedInstanceState);
          setContentView(R.layout.home_1);
  
          String [] a = null;
  
          ImageAdapter mAdapter = new ImageAdapter(this);
  
          Bitmap mBitmap = null; 
  
  
          for(int i = 0; i &lt; 8; i++)
          {   
              mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.a1 + i );
              ImageAdapter.addImage(mBitmap, "sample_"+1+".jpg");
          }
  
  
          GridView gridview = (GridView) findViewById(R.id.home_1);
          gridview.setAdapter(mAdapter);
          registerForContextMenu(gridview);
  }
  </code></pre>