创建新 xml 文件时出现问题

发布于 2024-09-25 12:01:08 字数 296 浏览 0 评论 0原文

我正在尝试在 /res/drawable 中创建一个新的 xml 文件(在 eclipse 中为 android 开发),

我得到的消息是;

在此找到多个注释 线: - 文件过早结束。 - 错误:解析 XML 时出错:未找到元素

当我在正确的文件夹中时,我按 New>File ,然后将其命名为 ic_tab_artists.xml,然后在我收到消息后 ^

所以,我做错了什么?

I'm trying to create a new xml file in /res/drawable (developing for android in eclipse)

the message i get is ;

Multiple annotations found at this
line:
- Premature end of file.
- error: Error parsing XML: no element found

When I'm in the right folder i press New>File , then I name it to ic_tab_artists.xml, and right after i get the message ^

So, what am i doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寂寞陪衬 2024-10-02 12:01:08

尝试在文件中添加一些有意义的内容。例如:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"
    android:dither="true">

    <item 
        android:state_window_focused="false"
        android:drawable="@android:color/transparent" />    
</selector>

Try adding something that makes sense inside the file. For example:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"
    android:dither="true">

    <item 
        android:state_window_focused="false"
        android:drawable="@android:color/transparent" />    
</selector>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文