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 studio 项目的版本问题
- Android(安卓)统一View样式,textview样式
- Android新建项目报错android:icon="@drawable/ic_launcher"
- Android——4.2.2 文件系统文件夹分析
- adt20新建项目Android(安卓)Support library not installed问题
- cocos2d-x-3.1在eclipse中的环境搭建
- Android安装apk文件并适配Android(安卓)7.0详解
- Android国际化资源 文件夹命名规范
- Android设备开发中的一些解决办法