ImageView not keeping max height and width

Add the following to your XML code (Or use the appropriate function)

android:adjustViewBounds="true"

I don't know why this isn't a default, because it seems like it would be required for a large number of items. Still, adding this simple logic to your XML file will make all of the difference.


I havent. So, I ll be just guessing

  1. Did you try defining a ScaleType option?
  2. Check for opposing layout attributes that can cause the layout inflater to ignore the desired width/height values.
  3. I suppose you tried this already but use just Layout_height /Layout_width instead of min/max attributes..