&ldquo;No resource found&rdquo; When using <include layout=&ldquo;&rdquo;>

evershawn

New Member
In my project I have created a global header layout \[code\]global_header.xml\[/code\] and I use it in all of my layout XML files by using \[code\]<include layout="@layout/global_header.xml">\[/code\].I have used this method before, and I am currently using it in this project. My problem is that I have a layout with the following contents:\[code\]<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#FFFFFFFF" > <include layout="@layout/global_header" /> <ScrollView android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@global/header"> <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" > </RelativeLayout> </ScrollView></RelativeLayout>\[/code\]Contents of \[code\]global_header.xml\[/code\]:\[code\]<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+global/header" android:layout_width="fill_parent" android:layout_height="60sp" android:layout_alignParentTop="true" android:background="#FFDDDDDD" > <ImageView android:id="@+id/global_header_logo" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="5sp" android:layout_marginTop="5sp" android:adjustViewBounds="true" android:src="http://stackoverflow.com/questions/14618852/@drawable/header" /> <View android:layout_width="fill_parent" android:layout_height="1sp" android:layout_alignParentBottom="true" android:background="#FF000000" /></RelativeLayout>\[/code\]And I am getting an error on \[code\]android:layout_below="@global/header"\[/code\] saying that:\[quote\] error: Error: No resource found that matches the given name (at 'layout_below' with value '@global/header').\[/quote\]I have used the include in other layouts in the project and it works without a problem, but for whatever reason, this layout file will not load the ID from the header where as all other layouts do.The project will not build with this error even though I am sure that once running on the device it will find it not a problem, has anyone else had this problem? Is there solution/workaround?Any and all help is greatly appreciated.
 
Back
Top