Android Studio上 drawable与mipmap的区别

来源:互联网 发布:mac怎么局部截图 编辑:程序博客网 时间:2024/06/08 04:37

两者在使用上没有区别,可以把mipmap当做drawable来用,但mipmap比drawable缩放的性能更好。


所以最适合的方式就是:

mipmap存放图片资源,drawable存放selector或者shape之类的xml



扩展阅读:

Android官网解释的原文地址

http://developer.android.com/intl/zh-cn/tools/projects/index.html#ApplicationModules


官方对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的解释

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.

0 0
原创粉丝点击