Drawable和Mipmap資源的區別
區別
在apk安裝的時候,mipmap-xxx/
下的所有解析度的圖片都會保留,而drawablexxx/
下的圖片只有保留適配裝置解析度的圖片,其餘圖片會丟棄掉,減少了APP安裝大小。
It’s best practice to place your app icons inmipmap-
folders (not thedrawable-
folders) because they are used at resolutions different from the device’s current density。——fromAndroid 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. ——fromandroid-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. ——fromGoogle+ Message
用法
-
mipmapxxx/
下放置APP啟動圖示,以及需要高質量縮放動畫的圖片。 -
其他圖片資源放在
drawablexxx/
下。
參考
注:文章首發簡書和我的個人部落格永恆的碼流 。