Reputation: 2535
I am using Mono for Android in Visual Studio 2010.
Resources/Values/Colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="Red">#FF0000</color>
</resources>
Main.axml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="10dp">
<TextView
android:text="High Priority Calls"
android:textColor="@color/red"
android:textSize="18sp"
android:padding="10dp"
android:layout_margin="10dp" />
<ListView
android:id="@+id/urgentCalls"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="8dp"
android:layout_margin="8dp" />
</LinearLayout>
Build Error: No resource found that matches the given name (at 'textColor' with value '@color/red').
I've stared at this for a while now and I just don't see my mistake.
Upvotes: 0
Views: 1785
Reputation: 10139
Update your Colors.xml file to use lowercase:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="red">#FF0000</color>
</resources>
Upvotes: 4