How to scale an Image in ImageView to keep the aspect ratio
- by michael
Hi,
In android, I defined an ImageView's layoutWidth to be 'fill_parent' (which takes up the full width of the phone). My question is if the Image i put to ImageView is bigger than the layoutWidth, android will scale it, right?
But what about the height? when android scale it, will it keeps the aspect ratio?
What I find out is, there is some 'white space' at the top/bottom of the ImageView when android scales an image which is bigger than the ImageView. Is that true? If yes, how can I eliminate that white spaces?
Thank you.