Android Studio 图片资源存放位置 + drawable文件夹的创建方法

在使用AndroidStudio时,项目用到的图片资源存放的位置,是放在drawable下? 还是放在mipmap下?

其实google官方已经给出相关介绍:

 

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.

也就是说一般将APP的icon放在minmap文件夹下,其他图片资源放在drawable文件夹下。

------------------------------------------------------------------------------------------------------------------

创建项目时候,AndroidStudio会自动创建一个drawable文件夹,如果需要创建针对存放不同尺寸的图片的文件夹,咋整?接下来我们再来说说AndroidStudio下创建drawable-hdpi、drawable-mdpi、drawable-xhdpi、drawable-xxhdpi的方法。

首先,切换到Project视图下,找到对应moudle的res文件夹,然后执行下面步骤:

然后,选择drawable,按照图片所示步骤

点击OK,就可以看到我们要创建的文件夹了。

 

评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

hellokandy

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值