title: Show images without spacing in a gridview
body: <p>I want to show images in a two column grid without vertical or horizontal spacing.The images are loaded using Picasso library. This is my code. In most cases it works fine. But in some devices in landscape mode there are spacing between images. How to correct it.</p>
  <p>GridView:</p>
  <pre><code>&lt;GridView 
  android:layout_width=&quot;match_parent&quot;
  android:layout_height=&quot;wrap_content&quot;
  android:verticalSpacing=&quot;0dp&quot;
  android:horizontalSpacing=&quot;0dp&quot;
  android:numColumns=&quot;2&quot;
  android:id=&quot;@+id/movie_grid_view&quot;
  /&gt;
  </code></pre>
  <p>image_layout.xml :</p>
  <pre><code>&lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
  android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;wrap_content&quot;
  android:gravity=&quot;center_horizontal&quot; &gt;
  &lt;ImageView
      android:id=&quot;@+id/movie_poster&quot;
      android:layout_width=&quot;fill_parent&quot;
      android:layout_height=&quot;wrap_content&quot;
      android:adjustViewBounds=&quot;true&quot;
      android:scaleType=&quot;fitCenter&quot; /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  <p>In the cursor adapter:</p>
  <pre><code>@Override
  public View newView(Context context, Cursor cursor, ViewGroup parent) {
      View view = LayoutInflater.from(context).inflate(R.layout.image_layout, parent, false);
      return view;
  }
  
  @Override
  public void bindView(View view, Context context, Cursor cursor) {
  
      ImageView v= (ImageView) view.findViewById(R.id.movie_poster);
      Picasso.with(mContext).load(cursor.getString(col_img)).into(v);
  }
  </code></pre>
  <p>In landscape mood there are spaces between images</p>
  <p><a href="https://i.stack.imgur.com/AlFH8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AlFH8.png" alt="enter image description here" /></a></p>