mipmap和drawable文件夹的区别
在Android上创建工程,会默认创建mipmap文件夹。之前在Eclipse上创建的是drawable的文件夹。那么这两个有什么区别呢?
问题:
I’m working with android studio 1.1 Preview 1
我使用android studio 1.1 Preview 1版本工作。
And I noticed that when I create a new project I’m getting next hierarchy:
我注意到当创建新的工程时,得到了下面的目录层级:
mipmap folders for diffrent DPIs, No more diffrent DPIs drawable folders.
4个不同分辨率的mipmap文件夹,与不同DPI的drawable文件夹没啥区别。
Should I put all my resources in the mipmap folders, or just the app icon?
我应该把所有资源都放到mipmap文件夹么?或者只放应用的图标?
答案:
The mipmap folders are for placing your app icons in only. Any other drawable assets you use should be placed in the relevant drawable folders as before.
mipmap文件夹只放应用图标。其他需要使用的drawable资源象之前一样放到对应的drawable文件夹。
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"
结论:
mipmap仅仅用于应用启动图标,可以根据不同分辨率进行优化。其他的图标资源,还是要放到drawable文件夹中。
参考[1]:http://stackoverflow.com/questions/28065267/mipmap-vs-drawable-folders
参考[2]:http://stackoverflow.com/questions/23935810/mipmap-drawables-for-icons
更多相关文章
- Android模拟器分辨率介绍
- Android——4.2.2 文件系统文件夹分析
- Android国际化资源 文件夹命名规范
- Android在MTP模式下,只显示指定文件夹
- Android屏幕分辨率正确获取及PX,DPI,DP,SP等的对应关系
- android2.2资源文件详解4--menu文件夹下的菜单定义
- android mtk6592 禁止拖动主界面图标
- [置顶] android 图标的绘制