android - 创建新 xml 文件的问题

标签 android eclipse htc-android

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

我得到的消息是;

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

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

那么,我做错了什么?

最佳答案

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

<?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>

关于android - 创建新 xml 文件的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3846093/

相关文章:

java - 如何在fragment Activity 下填充自定义 ListView (扩展Fragment)

java - 在 Eclipse 中安装插件要求我重新启动 Eclipse

eclipse - 如何调试 JSF/EL

android - 为我的 HTC 设备构建 AOSP

android - HTC One X 上隐藏了部分选项菜单

java - 无法通过 EditText 接受整数值

java - 无法使用动态数据在 RecyclerView 中显示项目

android - HTC Windows 7 驱动程序

java - 在 Webview 中加载 TXT 中的 URL

java - 在 hadoop 的提示符下创建和运行可运行的 jar