簡體   English   中英

嘗試運行時顯示的消息

[英]message displayed when trying to run

錯誤:錯誤:找不到與給定名稱匹配的資源(在“提示”中,值為“ @ 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" />

檢查是否不小心將values文件夾移出了res文件夾。

這也可能是由xml布局文件中的錯誤引起的。您必須將@id/meid更改為@+id/meid

前往此處查看更多信息

您在res/values/strings.xml文件中缺少字符串“ edit_message”。

添加值,例如:

strings.xml

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM