好吧,我已經在Android開發者網站的教訓樣品之後,代碼是這樣的:構建簡單的用戶界面課樣品
<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/edit_message')。
說明 錯誤:錯誤:找不到與給定名稱匹配的資源(位於'文本',值爲'@ string/button_send')。
現在這些值在strings.xml文件中定義。所以我不知道爲什麼我會得到這些錯誤。
任何人誰可以幫助這裏是一個很大的提前感謝。
您是否保存了'strings.xml',保存了佈局,然後清理了項目(如果有必要)? – Sam