剛開始編程的機器人,我試圖做一個簡單的xml
文件,但似乎有一些問題與android:[email protected]/..
沒有資源發現
我有這個錯誤:
error: Error: No resource found that matches the given name (at 'text' with value '@string/ false_button').
對於每個弦的..
的代碼是:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width = "match_parent" android:layout_height="match_parent" android:gravity="center" android:orientation="vertical" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding= "24dp" android:text="@string/question_text"/> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" > <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/true_button"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/false_button"/> </LinearLayout> </LinearLayout>
你有沒有宣佈false_button在string.xml – InnocentKiller
現在只是嘗試使用普通的字符串,而不是'@字符串/ false_button',看看是否可行。使用:'android:text =「False」/>' –