I am creating android app.
My phone is Galays S3
I created a png file which is also a background of the app with size W: 680px - H: 120pdx.
it fits fine. But when I run that on emulator the image is stretched and only see about 50% of the background image..
I called in the background image by the following code..
all the drawlble folders such as hdpi , mdpi , xhdpi, xxhdpi has the same file with same respolution and size.. bg.png . size W: 680px - H: 120pdx.
It really depends on what you want to achieve but it looks like you should use
scaletype="centercrop". You will get your image full screen but cropped. If you want it full screen and streched in lower resolution then use
It's really difficult to know exactly what you have in mind as you should explain :
Other options : http://developer.android.com/reference/android/widget/ImageView.html#attr_android:scaleType
If you don't want to stretch it you can use
Actually, if the devices are different, you have to choose between stretch it or not display all of it.
You can find all the possible values of
You need to make sure that your Android emulator's display resolution the same as that of the Galaxy S3 phone you have. If it's not, you need to scale your image to fit your emulator display. Also, if you want the ImageView to stretch to fill the display, you need to use "match_parent" instead of "wrap_content". Be aware that this will affect image quality.