Android程序员android UI

Drawable和Mipmap资源的区别

2019-01-19  本文已影响3人  十思叶

区别

在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

用法


参考


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


上一篇下一篇

猜你喜欢

热点阅读