【Android】drawable VS mipmap

Android Studio 创建工程后默认的资源文件夹如下图所示:
704364-20170719095235536-482846267.png

一直有些疑惑的是 mipmapdrawable 文件夹有什么区别,以及是否还需要创建 drawable-xhdpi, drawable-xxhdpi 等文件夹来存放更高分辨率的图片。

Stack Overflow 上有关的解释如下:

The mipmap folders are for placing your app/launcher icons (which are shown on the homescreen) in only. Any other drawable assets you use should be placed in the relevant drawable folders as before.

704364-20170719111612318-1275336345.png

官方博客的解释:
mipmap 文件夹:

res/
   mipmap-mdpi/
      ic_launcher.png
   mipmap-hdpi/
      ic_launcher.png
   mipmap-xhdpi/
      ic_launcher.png  
   mipmap-xxhdpi/
      ic_launcher.png
   mipmap-xxxhdpi/   
      ic_launcher.png  # App icon used on Nexus 6 device launcher

drawable 文件夹:

res/
   drawable-mdpi/
      ic_sunny.png
   drawable-hdpi/
      ic_sunny.png
   drawable-xhdpi/   
      ic_sunny.png
   drawable-xxhdpi/  # Fall back to these if xxxhdpi versions aren’t available
      ic_sunny.png 
   drawable-xxxhdpi/ # Higher resolution assets for Nexus 6
      ic_sunny.png

也就是说,mipmap 文件夹仅仅是用来存放 APP 的启动图标的,而 APP 中用到的其他资源图片仍需放到对应的 drawable 文件夹中。

参考链接:

  1. https://stackoverflow.com/questions/28065267/mipmap-vs-drawable-folders
  2. https://android-developers.googleblog.com/2014/10/getting-your-apps-ready-for-nexus-6-and.html

转载于:https://www.cnblogs.com/jaxer/p/7204131.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值