执行widget @ <drawable> </drawable>时strings.xml中的错误

时间:2014-02-23 15:28:50

标签: android xml android-widget

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">Widget_demo</string>
    <string name="action_settings">Settings</string>
    <drawable />
</resources>

我在行<drawable />中收到以下错误:

error: A 'name' attribute is required for `<drawable>`

2 个答案:

答案 0 :(得分:0)

更改

<string name="app_name">Widget_demo</string>
<string name="action_settings">Settings</string>
<drawable /> // remove this

<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Widget_demo</string>
<string name="action_settings">Settings</string>
</resources>

同时浏览文档

http://developer.android.com/guide/topics/resources/string-resource.html

答案 1 :(得分:0)

删除以下内容:

<drawable />