Right now, I'm developing the Android app using SDK 1.5 and testing application on HTC Hero, its firmware Android 1.5 is.
Let me come to the real point: In the application, I have an image view (image resolution 320 * 480) to display the image, now the image view is fully displaying the image in full screen, but when I'm trying to test this HTC EVO 4G (480 × 800 resolution), the image is expanded.
So, what do I like to do, display 320 * 480 resolution image in all screen-resolution mobile? I mean, if the image should be displayed in the "center" portion of the screen, then the mobile is from high resolution (i.e. 480 * 800, 480 * 854, or other).
To display the image in resolution except for all screen (without dragging or cutting) except 320 * 480, what features do I have to set?
Just set the scaleType
attribute of your image view to the potential value here: You may want to use CENTER
. Apart from this, you have to face another problem: You will also need to provide an HDPi image in addition to your MDPI image so that your MDPI image has not automatically reached HDPI by Android system, read more here:
Edit: Oh, and I almost forgot: 'Drawable-MDPI' and 'Drawable-HDPI Folders' are only possible if you at least have your project against Android 1.6 You need to set 3 to your minSdkVersion
and 4 from your targetSdkVersion
and then to keep your images in the normal 'Drawable' folder to catch Android 1.5 . To learn more, check out this video from Google I / O:
Comments
Post a Comment