如何将图像添加到“drawable"Android Studio 中的文件夹? [英] How to add an image to the "drawable" folder in Android Studio?

查看:43
本文介绍了如何将图像添加到“drawable"Android Studio 中的文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将图像添加到 res/drawable 文件夹...

I need to add an image to the res/drawable folder...

当我选择new >Image Asset,弹出一个对话框选择Asset Type...

When I choose new > Image Asset, it comes out a dialog to choose Asset Type...

如何将图像添加到 res/drawable 文件夹?

How can I add an image to res/drawable folder?

推荐答案

对于 Android Studio 1.5:

  1. 右键点击 res -> new -> Image Asset
  2. 资产类型上选择操作栏和标签图标
  3. 选择图片路径
  4. 在资源名称中为您的图像命名
  5. 下一步->完成

Android Studio 2.2 更新:

  1. 右键点击 res -> new -> Image Asset

图标类型上选择操作栏和标签图标

资产类型上选择图片

路径上选择您的图片路径

下一步->完成

图像将保存在/res/drawable 文件夹中.

The image will be saved in the /res/drawable folder.

警告!如果您选择使用 SVG 或 PNG 中的图标以外的图像,请注意,如果图像不透明,它可能会变成灰色.您可以在此问题的评论中找到答案,但这些都没有经过我的验证,因为我从未遇到过这个问题.我建议你使用这里的图标:Material icons

Warning! If you choose to use images other than icons in SVG or PNG be aware that it could turn grey if the image is not transparent. You can find an answer in comments for this problem but none of these are verified by me because I never encountered this problem. I suggest you to use icons from here: Material icons

这篇关于如何将图像添加到“drawable"Android Studio 中的文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆