This attribute must be localized.錯誤解決方式

eclipse中編譯沒有問題,但是在make自己建立的項目的時候,
提示了錯誤“This attribute must be localized”,這種問題一般情況是因爲在res/xml文件夾下的中
或者在res/layout下的文件中出現了沒有多語言話的文本例如
<TextView
android:id="@+id/myTextView1"
android:text="type"
android:layout_width="fill_parent">
</TextView>

解決方式
在res/values/strings.xml中定義字符串
<string name="str_type">type</string>

然後把上面的內容改爲
<TextView
android:id="@+id/myTextView1"
android:text="@string/str_type"
android:layout_width="fill_parent">
</TextView>

這是android強制實行多語言話
這樣修改之後問題能得到解決
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章