android studio -- 图片应该放在drawable还是mipmap?

android studio 的图片放置
最近使用android studio做一些简单的开发,最后需要放置图片的时候看一下历来的目录,还是有写迷惑,果断google了一下。

在Eclipse中根据图片的像素大小把,png或.jpg的图片放在drawable文件夹下,如drawable-hdpi,drawable-ldpi,drawable-mdpi,drawable-xhdpi,drawable-xxhdpi.同一张图片放在不同的drawable文件夹下,显示的时候会有所不同。但是在xml中引用的时候是一样的。

Android Studio则不一样,没有这么多的drawable目录了,而只有一个drawable文件夹。只需要把图片放里面就好。尝试过新建drawable-hdpi,drawable-ldpi文件夹,是不能被ide显示的,应该是不支持了吧。

一下是google的文档,链接:http://developer.android.com/tools/projects/index.html#mipmap
图片还是放在drawable文件夹下,mipmap只放launcher icons就好了。

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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值