在RelativeLayout布局時(shí),在中間的控件需要頂?shù)剿闲糇蟆⑾旅娴目丶剑虼耸褂昧?/p>
android:layout_below="@id/toolbar"
android:layout_above="@id/navigator"
編譯出現(xiàn)錯(cuò)誤
No resource found that matches the given name (at 'layout_above' with value '@id/
原因是找不到對(duì)應(yīng)的資源,因?yàn)閚avigator的定義在當(dāng)前控件后面飞袋。但是之前這樣寫過(guò)沒(méi)出現(xiàn)問(wèn)題戳气,所以和之前的代碼對(duì)比了一下發(fā)現(xiàn)少了+號(hào)。
正確寫法:
android:layout_below="@id/toolbar"
android:layout_above="@+id/navigator"
id前加個(gè)+
或者把navigator的定義寫在前面巧鸭。