如何将图像添加到“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:
- 右键点击 res -> new -> Image Asset
- 在资产类型上选择操作栏和标签图标
- 选择图片路径
- 在资源名称中为您的图像命名
- 下一步->完成
Android Studio 2.2 更新:
右键点击 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