Drawable-hdpi,Drawable-mdpi,Drawable-ldpi Android

我一直在研究 Android 1.5,但现在我已经转向最新的版本了。所以在 Android 1.5中只有一个“可绘制”的文件夹,但是现在在 Android 项目中有三个不同的文件夹用于存储图像。

我找到了这三个文件夹的一些文章

  1. Hdpi 的意思是高 dpi
  2. Mdpi 的意思是中等 dpi
  3. 低密度脂蛋白指的是低密度脂蛋白

但是,这三个文件夹的确切用途是什么? 什么时候应该使用特定的文件夹来存储图像?

104364 次浏览

To declare different layouts and bitmaps you'd like to use for the different screens, you must place these alternative resources in separate directories/folders.

This means that if you generate a 200x200 image for xhdpi devices, you should generate the same resource in 150x150 for hdpi, 100x100 for mdpi, and 75x75 for ldpi devices.

Then, place the files in the appropriate drawable resource directory:

MyProject/
res/
drawable-xhdpi/
awesomeimage.png
drawable-hdpi/
awesomeimage.png
drawable-mdpi/
awesomeimage.png
drawable-ldpi/
awesomeimage.png

Any time you reference @drawable/awesomeimage, the system selects the appropriate bitmap based on the screen's density.

I got one good solution. Here I have attached it as the image below. So try it. It may be helpful to you...!

Enter image description here