【发布时间】:2011-07-22 16:37:52
【问题描述】:
首先让我说我是 Android 编程的新手。我正在使用 Pragmatic 的 Hello Android 书(第 3 版)。我正在研究流行的数独游戏示例,在从书中复制要放在 main.xml 文件中的代码后,我收到以下错误:
error: Error: No resource found that matches the given name (at 'background' with value '@color/background')
.
error: Error: No resource found that matches the given name (at 'text' with value '@string/main_title').
error: Error: No resource found that matches the given name (at 'text' with value '@string/continue_label').
error: Error: No resource found that matches the given name (at 'text' with value '@string/new_game_label').
error: Error: No resource found that matches the given name (at 'text' with value '@string/about_label').
error: Error: No resource found that matches the given name (at 'text' with value '@string/exit_label').
它们可能都是相关的,但经过一番搜索,我不知道问题是什么。有什么建议吗?
【问题讨论】:
-
从 res 目录的 Values 文件夹中发布您的 strings.xml 和 colors.xml 文件。您的资源文件夹中的某些内容可能已损坏
-
你把值放到xml文件里了吗?