title: How to set both min and max size for an ImageView in Android
body: <p>I would like so specify both min. width/height and max. width/height for an ImageView. The image should be scaled  to fit.</p>
  
  <p>Doing this:</p>
  
  <pre><code>&lt;ImageView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:minWidth="100dp"
      android:maxWidth="200dp"
      android:minHeight="100dp"
      android:maxHeight="200dp"
      android:src="@drawable/ic_launcher" /&gt;
  </code></pre>
  
  <p>the min. width and height perform as they should, but max. width and height are ignored.</p>
  
  <p>If I set android:adjustViewBounds="true":</p>
  
  <pre><code>&lt;ImageView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:adjustViewBounds="true"
      android:scaleType="fitCenter"
      android:minWidth="100dp"
      android:maxWidth="200dp"
      android:minHeight="100dp"
      android:maxHeight="200dp"
      android:src="@drawable/ic_launcher" /&gt;
  </code></pre>
  
  <p>than, the max. width and height perform as they should, but min. width and height are ignored.</p>
  
  <p>Is there a way to have both?</p>