I have a picture that is very very more large (2100 px) than long(700 px)
The matter is, i want to import it in my android project to display it on the phone.
To import it I use "Image Asset", and Android Studio resizes it to be drawable (mdpi, hdpi, xhdpi...). The fact is, wherever the new size is, Android studio squares it by putting transparent component in longer size. And after, because of that, when I display it in a ImageView, there is a lot of transparency at the bottom at the image, and the component which should be at the bottom is not close to the "true" image!
How can I do to avoid the square resize of the Image by Android Studio?
Thanks for answers ;)
答案 0 :(得分:0)
在ImageView上设置
android:scaleType="center"
或者你可以选择其中一个: http://developer.android.com/reference/android/widget/ImageView.ScaleType.html