搜尋此網誌

2012年2月6日 星期一

Eclipse:No resource found that matches the given name (...)

一、在Eclipse的專案中,在 res/layout/main.xml中記錄一些元件
二、但若某些資源沒要先做”宣告”的動作
  即會出現「No resource found that matches the given name (...)」,如:
<TextView   android:id="@+id/MyText"   android:layout_width="wrap_content"   android:layout_height="wrap_content"   android:text="@string/str_1"   android:layout_x="61px"   android:layout_y="69px"   > <TextView> 三、在res/values/strings.xml中加入
  「<string name="str_1"> STRING </string>」即可解決錯誤。

沒有留言:

張貼留言