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文件夹中。

Android 官方解释[3]:

Note: You should place all launcher icons in the res/mipmap-[density]/ folders, rather than drawable/ folders to ensure launcher apps use the best resolution icon. 
注意:你应当将虽有启动图标放到res/mipmap-[density]/文件夹中,而不是drawable/文件夹,来确保启动图片使用最好的分辨率图标。

参考[1]:http://stackoverflow.com/questions/28065267/mipmap-vs-drawable-folders 
参考[2]:http://stackoverflow.com/questions/23935810/mipmap-drawables-for-icons 
参考[3]:https://developer.android.com/training/multiscreen/screendensities.html

mipmap和drawable文件夹的区别的更多相关文章

  1. Android:不同drawable文件夹的区别

    4.0后,新建android工程,会自动生成drawable,drawalbe-ldpi,drawable-mdpi,drawable-hdpi,drawable-xhdpi,drawable-xxh ...

  2. 关于Android中图片大小、内存占用与drawable文件夹关系的研究与分析

    原文:关于Android中图片大小.内存占用与drawable文件夹关系的研究与分析 相关: Android drawable微技巧,你所不知道的drawable的那些细节 经常会有朋友问我这个问题: ...

  3. Android学习笔记之Drawable 文件夹

    PS:最近闲着无聊..模仿去写个QQapp..效果还不错..并且从中又学习到了一些相关的东西,在这里进行一些相关总结.. 学习内容: Android 中 Drawable 文件夹内部相关属性..   ...

  4. Android Studio 复制粘贴图片到drawable文件夹没有效果 - 解决方法

    我想放一些图片到drawable文件夹里面,但是简单的复制文件,粘贴文件,或者拖拽文件,都不起作用.不知道为什么,之前是可以的,突然就不行了. 解决方案 在drawable文件夹的目录上右键,选择Re ...

  5. AndroidStudio 新建不同的Drawable文件夹

    以前习惯eclipse开发Android的朋友们知道 新创建一个Android项目的时候eclipse会自动生成多个drawable文件夹来存放图片 但是Android Studio 新建项目的时候只 ...

  6. vue-cli中自定义路径别名 assets和static文件夹的区别

    转自:vue-cli中自定义路径别名 assets和static文件夹的区别 静态资源处理: assets和static文件夹的区别 相信有很多人知道vue-cli有两个放置静态资源的地方,分别是sr ...

  7. Android 适配(drawable文件夹)图片适配(二)

    参考自(https://blog.csdn.net/myoungmeng/article/details/54090891) Android资源文件存放: android的drawable文件一共可以 ...

  8. assets文件夹与static文件夹的区别

    assets文件夹与static文件夹的区别原地址==>https://www.cnblogs.com/x123811/p/9230700.html 相同点===>assets文件夹和st ...

  9. iOS Xcode工程目录的 folder 和 group的区别(蓝色和黄色文件夹的区别)

    1. 来自 http://blog.csdn.net/fanjunxi1990/article/details/9352917 XCode工程目录里面,有时你会发现2个不同颜色的文件夹,一种是蓝色的, ...

随机推荐

  1. Laravel attribute casting 导致的 Indirect modification of overloaded property

    在 Laravel model 中,设置了某个属性做 array casting. protected $casts = [ 'rounds' => 'array', ]; 但是在 contro ...

  2. easyUI拖动:draggable()方法运用

    <!DOCTYPE html><html><head> <meta charset="utf-8"> <title>de ...

  3. python 全栈开发,Day91(Vue实例的生命周期,组件间通信之中央事件总线bus,Vue Router,vue-cli 工具)

    昨日内容回顾 0. 组件注意事项!!! data属性必须是一个函数! 1. 注册全局组件 Vue.component('组件名',{ template: `` }) var app = new Vue ...

  4. 【C++ Primer 第11章】4. 无序容器

    一.介绍 1. Hashtable和bucket 由于unordered_map内部采用的hashtable的数据结构存储,所以,每个特定的key会通过一些特定的哈希运算映射到一个特定的位置,我们知道 ...

  5. centos6.5上安装配置telnet服务

    https://blog.csdn.net/wx5040257/article/details/78327915

  6. JDK和CGLIB生成动态代理类的区别

     关于动态代理和静态代理 当一个对象(客户端)不能或者不想直接引用另一个对象(目标对象),这时可以应用代理模式在这两者之间构建一个桥梁--代理对象. 按照代理对象的创建时期不同,可以分为两种: 静态代 ...

  7. python单例模式的实现

    1 线程不安全的单例模式 # -*- coding:utf-8 -*- from __future__ import unicode_literals import functools def sin ...

  8. Nginx 关键字详解

    转自: https://blog.csdn.net/zhangliangzi/article/details/78257593 1.[alias]——别名配置,用于访问文件系统,在匹配到locatio ...

  9. SAC#1 - 组合数

    P3414 SAC#1 - 组合数 组合数的性质,求(1<<(n-1))%mod即可.其实要快速幂. #include<bits/stdc++.h> #define MOD 6 ...

  10. js类型判断-丰富加好用

    一, 自己有时候写一些东西,要做类型判断,还有测试的时候,对于原生的和jQuery中的类型判断,实在不敢恭维,所以就写了一个好用的类型判断,一般情况都够用的. function test(type) ...