我是新來的Android編程,我不明白我在做什麼錯。 我儘量讓這樣的按鈕,在XML文件:Android的呈現問題未能解決資源@字符串/ APP_NAME
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/btnText"
android:id="@+id/button"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />
也能正常工作,而機器人:文本=「@字符串/ btnText」的一部分......
我的strings.xml文件看起來是這樣的:
<string name="btnText">GO!</string>
我收到此錯誤信息: 呈現問題未能解決資源@字符串/ APP_NAME(2個類似的錯誤,未顯示)
問題是按鈕文本說@字符串/ btnText而不是GO!
1.清潔並生成項目。 2.檢查,如果你已經使用了字符串出現在strings.xml中 – TheLostMind
清理並生成沒有在所有的工作。正如你所看到的,我已經在strings.xml文件中調用了他的字符串標記。 – CoderOgden
你的strings.xml應該包含app_name。它在嗎? – TheLostMind