create shape xml file in drawable folder in android studio

前端 未结 3 1834
野性不改
野性不改 2021-01-03 22:26

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 androi

相关标签:
3条回答
  • 2021-01-03 22:59

    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.

    0 讨论(0)
  • 2021-01-03 23:11

    follow these steps

    1. create a drawable folder in res directory.(if not present)

    2. right click on drawable folder> New > Drawable resource file

    3. Give your file a name and change the root element to shape. (its selector by default)

    now you are good to go.

    0 讨论(0)
  • 2021-01-03 23:20
    1. Right Click On drawable folder
    2. Select New -> XML -> Layout File
    3. Type Root Element shape
    0 讨论(0)
提交回复
热议问题