如何添加XML绘制在Eclipse中 [英] How to add XML drawable in Eclipse

查看:225
本文介绍了如何添加XML绘制在Eclipse中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好球员,我这里一点堆积。根据官方文档谷歌表示,一旦你定义XML的可绘制对象,将文件保存在您的项目的RES /绘制/目录下。是添加的XML抽拉到项目的方式。

Ok guys I'm little stacked here. According to official documentation Google says that "Once you've defined your Drawable in XML, save the file in the res/drawable/ directory of your project." is the way to add a XML drawable to the project.

但是当我创建ADT创建3种不同的绘制文件夹MDPI,华电国际,和LDPI项目。所以,当我想创造我的XML绘制,我右键单击我的绘制,华电国际文件夹,选择添加新的Andr​​oid XML文件,在那里我必须选择我要创建什么样的XML文件,但没有绘制来选择。

But when I created the project ADT created 3 different drawable folders for mdpi, hdpi, and ldpi. So when I wanted to create my XML drawable, I right click on my drawable-hdpi folder and select "Add new Android XML file", and there I have to select what kind of XML file I want to create, but there isn't "drawable" to select.

如果我创建新的文本文件并将其保存为button_drawable.xml的Eclipse说有文件中的错误,它不能建立我的项目。

If I create new text file and save it as button_drawable.xml Eclipse says that there is an Error in the file and that It can't build my project.

那么,请告诉我,你是怎么在Eclipse ADT中添加XML可绘制?

So, please tell me how do you add xml drawables in Eclipse ADT?

推荐答案

我有这个问题的时候。

I have that problem sometimes.

我总是创建XML绘制为新建文本文件。如果你得到一个错误的XML绘制创建后,检查XML语法,以确保没有在文件中没有错误,并试图清理项目(项目 - >洁净>您的项目)

I always create the XML drawable as "New text file". If you get an error after the XML drawable has been created, check the XML syntax to be sure there is no error in the file, and try to clean the project (Project->Clean->Your project)

好运气

这篇关于如何添加XML绘制在Eclipse中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆