本文翻译自:Mipmaps vs. drawable folders [duplicate]
This question already has an answer here: 这个问题已经在这里有了答案:
- Mipmap drawables for icons 11 answers 图标的Mipmap可绘制对象 11答案
I'm working with Android Studio 1.1 Preview 1. I noticed that when I create a new project I'm getting the following hierarchy: 我正在使用Android Studio 1.1 Preview1。我注意到在创建新项目时,我得到了以下层次结构:
Mipmap folders for different DPIs, no more different DPIs drawable folders. 用于不同DPI的Mipmap文件夹,没有其他不同的DPI可绘制文件夹。
Should I put all my resources in the mipmap folders, or just the app icon? 我应该将所有资源都放在mipmap文件夹中还是仅放在应用程序图标中?
#1楼
参考:https://stackoom.com/question/1tl3b/Mipmap与可绘制文件夹-重复
#2楼
The mipmap folders are for placing your app/launcher icons (which are shown on the homescreen) in only. mipmap文件夹仅用于放置您的应用程序/启动器图标(显示在主屏幕上)。 Any other drawable assets you use should be placed in the relevant drawable folders as before. 您使用的任何其他可绘制资产应像以前一样放置在相关的可绘制文件夹中。
According to this Google blogpost : 根据此Google博客文章 :
It's best practice to place your app icons in mipmap- folders (not the drawable- folders) because they are used at resolutions different from the device's current density. 最佳做法是将应用程序图标放置在mipmap-文件夹(而不是drawable-文件夹)中,因为它们的使用分辨率与设备的当前密度不同。
When referencing the mipmap- folders ensure you are using the following reference: 引用mipmap-文件夹时,请确保使用以下引用:
android:icon="@mipmap/ic_launcher"
The reason they use a different density is that some launchers actually display the icons larger than they were intended. 他们使用不同密度的原因是某些启动器实际显示的图标超出了预期。 Because of this, they use the next size up. 因此,他们使用下一个尺寸。