简体   繁体   English

为Android不同的屏幕分辨率缩放图像

[英]scaling images for android different screen resolutions

I am making an android app but the problem here is that there are dozens of android phones with different screen resolutions. 我正在制作一个android应用程序,但是这里的问题是有数十种具有不同屏幕分辨率的android手机。 So now I do not know which image sizes should I use. 所以现在我不知道应该使用哪种图像尺寸。 Is there a way to use one image and then android will scale it accordingly to screen resolution? 有没有一种方法可以使用一个图像,然后android会根据屏幕分辨率相应缩放它? If yes then which image size would be better? 如果是,那么哪种图像尺寸更好?

Yes even if you use only single image in drawable folder, Android system will resize it for all devices, but ofcourse with images distortion. 是的,即使您仅在可绘制文件夹中使用单个图像,Android系统也会为所有设备调整其大小,但是当然会出现图像失真。 Well you should only bother about Drawable-hdpi, mdpi, ldpi and x-hdpi folders and place images respectively into it. 好吧,您只应该担心Drawable-hdpi,mdpi,ldpi和x-hdpi文件夹并将图像分别放入其中。 Which differs in sizes. 大小不同。 And best one is to use MDPI. 最好的方法之一就是使用MDPI。

Its hard to understand, what i am suggested above, if you haven't read about this 它很难理解,我所建议的上面,如果你还没有读到

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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