Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add an image to the "drawable" folder in Android Studio?

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

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

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

like image 458
Alan W. Avatar asked Mar 14 '15 10:03

Alan W.


People also ask

How do I add an image to a drawable XML file?

Step 1: In this method first of all in your system find your required images and copy the image as we do normally. Step 2: Then open the Android Studio go to the app > res > drawable > right-click > Paste as shown in the below figure. Step 3: Then a pop-up screen will arise like below.

How do I add an image to a Visual Studio drawable folder?

Go to the solution explorer, select Resource--> drawable. Right click --> add--> Existing Item. or (Shift + Alt + A).


1 Answers

For 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:

  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.

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

like image 186
Chris Avatar answered Sep 22 '22 10:09

Chris