在Android studio中寫xml佈局文件都是會有提示的子 在我加入了 databinding 後忽然就不能提示了
原來是由於 一個xml 裏 只能有一個起做用android
xmlns:app="schemas.android.com/apk/res-aut…" 這是由於個人xml裏定義了兩個 xmlns:app ,xmlns:binding的緣由 而個人xml裏由於 xmlns:binding是寫在前面因此 只有 binding關鍵字起做用 而app是不提示的 以下圖bash
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:binding="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto">
複製代碼
而我一直用app 做爲關鍵字,因此會出現不能提示的問題app
關於 xmlns:xxxx="schemas.android.com/apk/res-aut…" 中 其中 xxxx 是能夠本身隨便設置的 然後面的連接是固定的。佈局
若是不是出現以上問題 還能夠:Invalidate Caches / Restart... 點擊 Invalidate and Restart 重啓一下spa