简体   繁体   中英

Android images not scaling properly

I still can't understand how images are scaled. I have this 600px x 600px image. I scaled it to different sizes (ie. to 450 x 450, 300x300 and 225x225). I did that in order for devices with different screen densities adjust the size of the image. Then I placed an imageview to a generic 1280x800 10.1" tablet, which is mdpi as stated by the ADT. It views properly on the 10.1 tablet graphical layout but seems oversized on the other devices especially on the phone category. Here is the link to image:

在此处输入图片说明

The layout width and height are also set to wrap_content, should I set it to a value in dp?

since, its an mdpi tablet, the resource is being picked from the drawable-mdpi folder and thus appearing that small.

Perhaps you can create a layout-mdpi-xlarge folder and then in that layout refer a copy of the image from the xhdpi folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM