title: Android ImageView setting Bitmap FitXY doesn't work
body: <p>I've been trying for a really long time to set the bitmap so it will fit the <code>ImageView</code> bounds. </p>
  
  <p>It just doesn't work via <code>scaleType: fitXY</code>. My bitmap images size are lower than the <code>ImageView</code>'s (Saved on 100X100 pixels), I want my bitmap images to fit and stretch into the <code>ImageView</code>.  </p>
  
  <p>Here's some code:</p>
  
  <pre><code>&lt;ImageView xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/imageView" 
     android:layout_height="match_parent"
     android:layout_width="match_parent"
     android:src="@drawable/locked_image"
     android:scaleType="fitXY"
  /&gt;
  </code></pre>
  
  <p>Here's the code of setting the <code>ImageView</code> (I'm setting the <code>scaleType</code> in different places for testing):</p>
  
  <pre><code>@Override
  public View getView(int position, View convertView, ViewGroup parent) {
    final ImageView imageView;
    if (convertView == null) {
      imageView = (ImageView) getLayoutInflater().inflate(R.layout.item_grid_image, parent, false);
      imageView.setScaleType(ScaleType.FIT_XY);
    } else {
      imageView = (ImageView) convertView;
      imageView.setScaleType(ScaleType.FIT_XY);
    }
  
    imageLoader.displayImage(imagesIds[position], imageView, options);
    imageView.setScaleType(ScaleType.FIT_XY);
    return imageView;
  }
  </code></pre>
  
  <p>Here's how it looks:</p>
  
  <p><img src="https://i.stack.imgur.com/ly4hil.png" alt="enter image description here"></p>
  
  <p><strong>As you can see, the Height of the <code>ImageView</code> is fine, but I want the Width of it to be the same.</strong> I do not have access to my bitmap image via my activity, so please don't ask me to resize my bitmap. I really don't understand why it just doesn't work as it should.</p>
  
  <hr>
  
  <p><strong>EDIT:</strong><br>
  Just to make the problem more understandable. The <code>ImageView</code> height is calculated for each device. It is different for each device. I want the width of my <code>ImageView</code> to be the same as the height as it is. I am using the <code>Two-WayGridView</code> library to show the images if it makes any difference.</p>