Drawable和Mipmap资源的区别

区别

在apk安装的时候,mipmap-xxx/下的所有分辨率的图片都会保留,而drawablexxx/下的图片只有保留适配设备分辨率的图片,其余图片会丢弃掉,减少了APP安装大小。

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。——from Android Developers Blog

Using a mipmap as the source for your bitmap or drawable is a simple way to provide a quality image and various image scales, which can be particularly useful if you expect your image to be scaled during an animation. ——from android-4.3

if you are building different versions of your app for different densities, you should know about the "mipmap" resource directory. This is exactly like "drawable" resources, except it does not participate in density stripping when creating the different apk targets. ——from Google+ Message

用法

  • mipmapxxx/下放置APP启动图标,以及需要高质量缩放动画的图片。

  • 其他图片资源放在drawablexxx/下。


参考


注:文章首发简书和我的个人博客永恒的码流


最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容