Android 您好视图/表单内容/Custon按钮教程错误

Android 您好视图/表单内容/Custon按钮教程错误,android,Android,由于成功地运行了“hello Android”,我正在编写使用Eclipse的教程。在res/drawable/中创建android_button.xml文件时,每个 <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/andr

由于成功地运行了“hello Android”,我正在编写使用Eclipse的教程。在res/drawable/中创建android_button.xml文件时,每个

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/android_pressed"
          android:state_pressed="true" />
    <item android:drawable="@drawable/android_focused"
          android:state_focused="true" />
    <item android:drawable="@drawable/android_normal" />
</selector>

恐怕我不知道哪些资源应该与名称匹配,或者我是否忽略了某些内容或命名错误。非常感谢帮助解决此问题

您可能错过了说明中的这一行:

将右侧的图像复制到项目的res/drawable/目录中。这些按钮将用于不同的按钮状态。

只需将这些小android图标复制到目录中,它就可以在您提供的屏幕上工作了。附近有三个android图标 android_button.xml代码。只需右键单击它们并“另存为”

将它们与android_button.xml一起保存在res/drawable目录中

注意,我假设您正在res/drawable目录中创建该xml文件 并在eclipse创建的drawable XXXX目录中添加注释。您将不得不手动操作
在res目录中创建一个可绘制的新文件夹,因为它不是默认的eclipse内容。

Yes-不知何故,我忽略了这一点。谢谢是的,谢谢!在最后一次尝试中,我选择了1.5版的API,它只创建了一个res/drawable目录。
Description Resource    Location    Type    Path
error: Error: No resource found that matches the given name (at 'drawable' with value '@drawable/android_focused'). android_button.xml  line 5  Android AAPT Problem    /HelloFormStuff/res/drawable
error: Error: No resource found that matches the given name (at 'drawable' with value '@drawable/android_focused'). android_button.xml  line 5  Android AAPT Problem    /HelloFormStuff/res/drawable