I am using Android studio 1.2.2 and need to know how to create a new shape file in drawable folder. I have already done the same in Eclipse but unable to do so in the android studio 1.2.2
Asked
Active
Viewed 7.1k times
3 Answers
44
follow these steps
create a drawable folder in res directory.(if not present)
right click on drawable folder> New > Drawable resource file
Give your file a name and change the root element to shape. (its selector by default)
now you are good to go.

Junior Mayhé
- 16,144
- 26
- 115
- 161

Anirudh Sharma
- 7,968
- 13
- 40
- 42
-
Thank you.. It is so much easier in Eclipse ADT where the root tag is displayed in a list for selection – Abhishek Deshpande Jul 17 '15 at 04:42
-
Yes.But it's autocomplete in android studio so have to type only sh and it will appear :) .Do accept the answer if it helps. – Anirudh Sharma Jul 17 '15 at 04:43
30
I was confused by the post from Anirudh when he said to change the root element to shape. But here is full demo.
Basically, the shape element is not provided by drawable resource file list by default. So just create one and then change the root xml element to shape, manually.

Fangming
- 24,551
- 6
- 100
- 90
-2
- Right Click On drawable folder
- Select New -> XML -> Layout File
- Type Root Element shape

Junior Mayhé
- 16,144
- 26
- 115
- 161

Mohammed Shehab
- 21
- 1
-
3In android studio, this is generating a layout xml file in layout folder. even can't move to drawable folder. So this is not an answer for this question. – Janaka R Rajapaksha Apr 30 '16 at 06:16
-
-