I’m trying to change my application data source to the sdcard so that it doesn’t take too much internal memory.
However, I had an Image that was dynamically loaded from the resource and displayed in an ImageView, now I load the image from the sdcard whenever I need it.
I had been using imageBox.setImageResource(imageID) and I changed to imageBox.setImageDrawable(imageDrawable).
The problem is that now Android resizes my image and it doesn’t fit where it should.
Why is it resizing the image this way? And how can I stop it?
Thanks in advance 🙂
Add the tag
android:scaleType="fitXY"to your ImageView’s layout XML.Ex.
Edit:
If your image is simply too big to fit inside the ImageView – it will have to do some kind of scaling. There are some other options as described in the API:
http://developer.android.com/reference/android/widget/ImageView.ScaleType.html