unable to use color.xml file in eclipse



i'm getting a no resources found at that given name @color/red. i have no clue why the colors are being recognized on my displayStudentInfo.activity. Please help.


Here is my colors.xml file



<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="blue">#0000ff</color>
<color name="red">#ff0000</color>
<color name="green">#00ff00</color>
<color name="black">#000000</color>

</resources>


Here is my DisplayStudentInfo.activity file



<LinearLayout xmlns:android="http://ift.tt/nIICcg"
xmlns:tools="http://ift.tt/LrGmb4"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>

<TextView android:id="@+id/text1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/line1"
android:textColor="@color/red" />

<TextView android:id="@+id/text2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/line2" />

<TextView android:id="@+id/text3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/line3"/>
<TextView android:id="@+id/text4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/line4"/>

No comments:

Post a Comment