区别
在apk安装的时候,mipmap-xxx/
下的所有分辨率的图片都会保留,而drawablexxx/
下的图片只有保留适配设备分辨率的图片,其余图片会丢弃掉,减少了APP安装大小。
It’s best practice to place your app icons in
mipmap-
folders (not thedrawable-
folders) because they are used at resolutions different from the device’s current density。——from Android Developers BlogUsing 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/
下。
网友评论