2015-09-20 150 views
5

Android Studio代碼完成似乎無法在xml上工作,並且它不能識別除Android支持v7視圖上的attrs之外的任何xml屬性。 截圖:Android Studio佈局錯誤:未知屬性

enter image description here

我的看法是從android.support.design.v7正確顯示:

enter image description here

+0

確保關閉的TextView作爲 –

+0

這是一塊我的代碼只是舉例。我在所有的xml文件中得到了這個錯誤 – morajabi

+0

您是否在佈局xml文件的頂部添加了'<?xml version =「1.0」encoding =「utf-8」?>'添加了 –

回答

1

如果你是Android的工作室,然後轉到工具,然後安卓然後單擊在用gradle構建時,它會解決錯誤。我也遇到過。

工具 - > Android->與搖籃

構建
+0

我沒有嘗試這個,但似乎它會完成這項工作。 – morajabi