how to create new android xml file in drawable folder that does not have Drawable resource

℡╲_俬逩灬. 提交于 2019-12-10 12:04:38

问题


this might sound silly. i am trying to do tab layout for android.

there is a part where i need to create a drawable folder and have android xml file in that particular folder.

i have looked into all the tutorial and youtube for this. The tutorial shows create a new android xml file and choose Drawable for the type of the resources.

in my case, i cannot create new android xml file with Drawable as the type of resources as Drawable does not exist. Below shows the interface.

is there anyway can help me with this? i also tried to add the resource manually but it wont work.

if i am creating a new android xml file with other resource type and force it to put in drawable folder, the application crash.


回答1:


1. Go to your project explorer which should be on the left side of your eclipse IDE.

2. Right click the res folder of your project

3. Click new, then folder

4. Name that folder drawable

5. Right click your new drawable folder, click new

6. Search for XML File in the XML folder

7. ENJOY :)

I'm not sure if i understand exactly what you mean, Is this what you want to do? If so then the steps provided is how to do so, if you need me to clarify let me know.




回答2:


Do the following,

your project -> new -> Folder -> write drawable in the text box -> finish

So, drawable folder is now created in res folder.

Then,

drawable -> new -> File -> enter the name of the xml file you want to create (ex. test.xml)

OR

drawable -> new -> Android XML File -> enter the name of the xml file you want to create (ex. test)

Now you can see there is a .xml file in your drawable folder. Now you do whatever you like to do with this .xml file.




回答3:


@Sara if you have successfully created your extra "drawable" folder, right click on the new "drawable" folder and go to new Android XML File, just name the new xml file and finish next.



来源:https://stackoverflow.com/questions/11714822/how-to-create-new-android-xml-file-in-drawable-folder-that-does-not-have-drawabl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!