Google官方关于mipmap和drawable的介绍
drawable/
For bitmap files (PNG, JPEG, or GIF), 9-Patch image files, and XML files that describe Drawable shapes or Drawable objects that contain multiple states (normal, pressed, or focused). See the Drawable resource type.
mipmap/
For app launcher icons. The Android system retains the resources in this folder (and density-specific folders such as mipmap-xxxhdpi) regardless of the screen resolution of the device where your app is installed. This behavior allows launcher apps to pick the best resolution icon for your app to display on the home screen. For more information about using the mipmap folders, see Managing Launcher Icons as mipmap Resources.
drawable:位图文件(.png、.9.png、.jpg、.gif)或编译为以下可绘制对象资源子类型的XML文件(位图文件、九宫格(可调整大小的位图)、状态列表、形状、动画可绘制对象、其他可绘制对象)。
mipmap:适用于不同启动器图标密度的可绘制对象文件。
StackOverflow上关于mipmap和drawable的区别
The mipmap folders are for placing your app icons in only. Any other drawable assets you use should be placed in the relevant drawable folders as before.
综上:mipmap文件夹适合放应用启动图标,而其他图片资源应该放在drawable文件夹下面。
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.
本文介绍了Android中mipmap和drawable资源文件夹的不同用途。mipmap主要用于存放应用启动图标,确保图标能在不同屏幕密度下保持清晰;drawable则用于存放其他位图资源如图片和9-patch图像等。
363

被折叠的 条评论
为什么被折叠?



