XML文件的Andr​​oid / Eclipse中/ premature结束结束、文件、Andr、XML

2023-09-13 01:52:38 作者:坐在坟地看星星

最后,让我承认我的确发现在这里过类似的问题,但只有一个答案,这个问题的答案在我的处境没有申请启动,使...

Let me start by acknowledging that I did find a similar question on here but there was only one answer and that answer did not apply in my situation, so...

我刚才涉水到Android和已经临到是症结所在。我使用Eclipse和所遇到的一个问题试图创建一个国家列表绘制,并不断收到一个错误在Eclipsepremature的文件结尾。我在我的绘制目录中的图像。我创建一个新的文件,将其命名为date.xml,然后键入以下内容:

I am just now wading into Android and have come upon a sticking point. I am using Eclipse and have run into a problem trying to create a state-list drawable and keep getting a "premature end of file" error in Eclipse. I have the images in my "drawable" directory. I create a new file, name it date.xml, and type the following:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/dategrey" android:state_selected="true" />
    <item android:drawable="@drawable/datewhite" />
</selector>

这是我得到确切的错误是文件premature结束错误解析XML:没有找到元素。该有我困惑,有明显的元素在里面。我在想什么?

The exact error that I am getting is "Premature end of file. Error parsing XML: No elements found.". The has me confused as there is clearly an element in there. What am I missing?

推荐答案

和我解决它。男人,多么愚蠢的事情让我混淆了两天!我清理项目,重建了XML文件,并能正常工作。我不知道发生了什么事情堵塞了,因为我从来没有真正试图运行项目所以不应该是一个问题,out.out,但它的工作。感谢所有谁提出建议。我真的做AP preciate你的时间和精力,帮助我这一个。

And I solved it. Man, what a goofy thing to have confound me for two days! I cleaned the project, rebuilt the xml file, and it works fine. I have no idea what was plugging things up as I had never actually tried to run the project so there should not have been an issue with out.out, but it worked. Thanks to all who offered advice. I truly do appreciate your time and attention in helping me with this one.