Android ImageView Fixing Image Size

Shalabh picture Shalabh · Aug 21, 2012 · Viewed 170.5k times · Source

I have an Android Application, where I have an ImageView, I need to keep the size constant, there can be various images that I need to put into this ImageView, of different sizes.

I just need to ensure that all the Images must fit into the ImageView, the Image should increase in size if it is smaller and should decrease, in case it is bigger.

Thanks a lot for your time.

Answer

Youngsik Oh picture Youngsik Oh · Aug 21, 2012

Fix ImageView's size with dp or fill_parent and set android:scaleType to fitXY.