问题描述
所以,最近我(像今天最近)开始尝试在Eclipse中工作。我一直在关注Android开发初学者当然,一切都很好,直到这一点。我已经得到了构建一个简单的用户界面(http://developer.android.com/training/basics/firstapp/building-ui.html#Button)和所做的一切都是一个字一个字,但是当我尝试运行它,它说了
So I recently (like today recently) began to try to work in eclipse. I've been following android developers beginners course, and everything went fine until this point. I've gotten to building a simple user interface (http://developer.android.com/training/basics/firstapp/building-ui.html#Button) and did EVERYTHING word for word, but when I try to run it it says that
没有资源的发现,(与'@字符串/ action_settings价值在标题)相匹配的名字。
我回去,并检查一切,我所做的一切,他们解释说,它仍然做到这一点?我是一个总的小白,所以也许我只是失去了一些东西,但我不知道是什么。我重新启动Eclipse和它仍然不会运行应用程序,并表示,对于百万次,我有一个错误。
I went back and checked everything, and I did everything as they explained and it still does this? I'm a total noob, so maybe I'm just missing something but I don't know what. I restarted eclipse, and it still wouldn't run the app, and said for the millionth time I have an error.
这是我的设计表:
在布局activity_main.xml
In layout activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<EditText android:id="@+id/edit_message"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/edit_message" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_send" />
</LinearLayout>
在值string.xml
in valuesstring.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">My First App</string>
<string name="edit_message">Enter a message</string>
<string name="button_send">Send</string>
<string name="menu_settings">Settings</string>
<string name="title_activity_main">MainActivity</string>
</resources>
而这一切,我已经搞砸。我看不出有问题?
and that's ALL I've messed with. I don't see a problem?
我失去了一些东西明显?
Am I missing something obvious?
推荐答案
哈哈 - 我做的教程,并得到了同样的事情。您复制/粘贴整个的strings.xml
文件,但这个文件丢失一个值,该应用程序的需求。这是在他们的教程中的错误。
ha - I am doing the tutorial and got the same thing. You copied/pasted the entire strings.xml
file, but this file is missing a value that the app needs. It's a bug in their tutorial.
添加此行回的strings.xml:
Add this line back to strings.xml:
<string name="action_settings">something here</string>
在哪里我把这里的东西:我不记得什么原文了。
Where I put "something here" I can't remember what the original text was.
问题是main.xml中(在RES /菜单),当然这是我们没有接触教程,引用字符串action_settings。从他们的榜样粘贴整个string.xml当你复制这已被删除/。
The problem is that main.xml (under res/menu), which of course we didn't touch in the tutorial, references the string "action_settings". This was deleted when you copied / pasted the entire string.xml from their example.
这篇关于没有资源的发现,(与'@字符串/ action_settings价值在“标题”)匹配给定的名字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!