在RelativeLayout布局时,在中间的控件需要顶到它上、下面的控件,因此使用了
android:layout_below="@id/toolbar"
android:layout_above="@id/navigator"
编译出现错误
No resource found that matches the given name (at 'layout_above' with value '@id/
原因是找不到对应的资源,因为navigator的定义在当前控件后面。但是之前这样写过没出现问题,所以和之前的代码对比了一下发现少了+号。
正确写法:
android:layout_below="@id/toolbar"
android:layout_above="@+id/navigator"
id前加个+
或者把navigator的定义写在前面。