The Color is defined in Resources/Values/Colors.xml...

<?xml version="1.0" encoding="utf-8"?>
<resources>
        <color name="GridHeadBG">#659ccf</color>
</resources> 

The reference to the Color is in Resources/Layout/ViewReports.axml...

        <LinearLayout
            android:id="@+id/criteriaLayout"
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginRight="10dp"
            android:background="@color/GridHeadBG">


Steve Sharrock
Architecture/Design/Programming
www.sharkcode.com

-----Original Message-----
From: Jonathan Pryor [mailto:j...@xamarin.com] 
Sent: Thursday, November 29, 2012 12:44 PM
To: st...@sharkcode.com; Discussions related to Mono for Android
Subject: Re: [mono-android] No resource found for Color

On Nov 29, 2012, at 1:18 PM, Steve Sharrock <st...@sharkcode.com> wrote:
> I use camel-case names (upper and lower)  for most resources
(styles/dimens/strings); but, I've noticed that referring to a Color
resource the reference from my .axml is forced to lower case and results
with the error...
>  
> No resource found that matches the given name (at 'background' with value
'@color/gridheadbg'
>  
> The Color name in this case is GridHeadBG.

Where is GridHeadBG coming from? Is it defined in a
Resources\Color\GridHeadBG.xml file [0]?

>  The work-around is pretty obvious - change all color resource names to
lower-case.

We do, for file-backed resource names. Resource names that come from
non-file sources -- e.g. +@id's within .axml files -- are  not altered.

Could you provide a more complete example?

Thanks,
 - Jon

[0]:
http://developer.android.com/guide/topics/resources/color-list-resource.html


_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to