Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
641 views
in Technique[技术] by (71.8m points)

android-studio - 如何在Android Studio中的“可绘制”文件夹中添加图像?(How to add an image to the “drawable” folder in Android Studio?)

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

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

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

(当我选择new > image asset ,出现一个对话框来选择Asset Type ...)

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

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

  ask by Alan Wang translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

For Android Studio 1.5 :

(对于Android Studio 1.5 :)

  1. Right click on res, new Image Asset

    (右键单击资源,新的图像资产)

  2. On Asset type choose Action Bar and Tab Icons

    (在资产类型上,选择操作栏和选项卡图标)

  3. Choose the image path

    (选择图像路径)

  4. Give your image a name in Resource name

    (在资源名称中为图像命名)

  5. Next->Finish

    (下一页->完成)

Update for Android Studio 2.2 :

(Android Studio 2.2更新:)

  1. Right click on res, new Image Asset

    (右键单击资源,新的图像资产)

  2. On Icon Type choose Action Bar and Tab Icons

    (在图标类型上,选择操作栏和选项卡图标)

  3. On Asset type choose Image

    (在资产类型上,选择图像)

  4. On Path choose your image path

    (在路径上选择图像路径)

  5. Next->Finish

    (下一页->完成)

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

(该图像将保存在/ res / drawable文件夹中。)

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.

(如果您选择使用SVG或PNG中的图标以外的图像,请注意,如果图像不透明,则可能会变成灰色。)

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

(我建议您从这里使用图标: 材质图标)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...