title: How to remove the space between rows of grid view in android
body: <p>In android grid view there is extra space between the rows of grid view. I am not adding any space to the gridview.</p>
  
  <p>here is my xml files</p>
  
  <pre><code>        &lt;GridView
                  xmlns:android="http://schemas.android.com/apk/res/android"
                  android:id="@+id/grid"
                  android:layout_width="fill_parent" 
                  android:layout_height="fill_parent"
                  android:horizontalSpacing="5px"
                  android:numColumns="3"
                  android:columnWidth="50dip"
                   android:verticalSpacing="0dip"
                  android:gravity="center"
                  /&gt;
  </code></pre>
  
  <p>and the other xml for the imageview which is adding view to the gridview is</p>
  
  <pre><code>        &lt;ImageView
              xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/singlePhoto"
              android:layout_gravity="top"
              android:layout_width="145dip"
              android:layout_height="145dip"
              android:layout_marginTop="0dip"
              android:layout_marginBottom="0dip"
              &gt;
          &lt;/ImageView&gt;
  </code></pre>
  
  <p>In Adapter class the code is</p>
  
  <pre><code>        if(mView == null){
              mView = mLayoutInflater.inflate(R.layout.newsgridthumbpic, null);
                  }
  
                  ImageView mImage = (ImageView)mView.findViewById(R.id.singlePhoto);
                  PhotoGridInfoSet mInfo = (PhotoGridInfoSet)details.get(position);
                  if(mImage != null){
                  mImage.setTag(mInfo.getPhotoThumbNailString());
                  mImage.setVerticalScrollBarEnabled(true);
                  mImage.setVerticalFadingEdgeEnabled(true);
                  }
          }!
  </code></pre>
  
  <p>The space is between the rows of gridview. I have not added any space anywhere in the code Still the there is vertical spacing.I am not able understand why there is space in between gridview rows. This space is not appearing in the hdpi device/emulator. This problem is in the mdpi and ldpi devices/emulator.</p>
  
  <p><img src="https://i.stack.imgur.com/Wh0rP.png" alt="Image for reference. this is what happening right now."></p>