尝试运行时显示的消息

时间:2014-07-31 15:42:14

标签: android eclipse string

错误:错误:找不到与给定名称匹配的资源(在"提示"值为" @ string / edit_message")

<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" />

2 个答案:

答案 0 :(得分:0)

检查您是否意外地将values文件夹移出res文件夹。

这也可能是由xml布局文件中的错误引起的。您必须将@id/meid更改为@+id/meid

通过here

查看更多信息

答案 1 :(得分:0)

您缺少字符串&#34; edit_message&#34;在res/values/strings.xml文件中。

添加值,例如:

<强>的strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
...
...
    <string name="edit_message">This is my edit message!</string>   
...
...    
</resources>
相关问题