到底哪种类型是drawable文件夹?

which type is drawable folder exactly?

drawable文件夹是什么类型? 我知道 drawable-ldpi,drawable-mdpi,drawable-hdpi,drawable-xhdpi,drawable-xxhdpi, drawable-xxxhdpi 和 drawable-nodpi。但是有一个名为drawable的文件夹。 那么它到底是哪一种呢?

drawable目录其实相当于drawable-mdpi。这种等效是为了保持向后兼容性(Android 的早期版本不需要支持多种屏幕密度)。

Commonsware 写道 a good blog post 提到了向后兼容性:

res/drawable/ is a synonym for res/drawable-mdpi/, for backwards compatibility with really old Android apps, written before we had density-specific resources.

如今,它对 XML 定义的可绘制对象很有用,例如形状或 vector drawables:

Because one vector drawable can be used on all pixel densities, this file goes in your default drawables directory (you don't need to use density-specific directories):

res/
  drawable/
    ic_android_launcher.xml