When will we plug all the leaky abstractions...
On Sep 17, 2012, at 11:14 AM, Andrew Gaspar <[email protected]>
wrote:
> I'm having an issue with Resource Aliases.
Is there any documentation on these Resource Aliases? The closest I found was
for ID resources:
http://developer.android.com/guide/topics/resources/more-resources.html#Id
However, the documentation doesn't state that <item/> can have a body. However,
the documentation for Integer Array and Typed Array both state that <item/> can
have a body which is a resource reference:
http://developer.android.com/guide/topics/resources/more-resources.html#IntegerArray
http://developer.android.com/guide/topics/resources/more-resources.html#TypedArray
> I'm trying to replicate this in MonoDroid to no avail. Here is the contents
> of the refs.xml file in my MonoDevelop project:
>
> <resources>
> <item type="layout"
> name="ActivityAthleteList">@layout/ActivityAthleteTwopane</item>
> </resources>
>
> The layout resource files are appropriately renamed from
> activity_athlete_list.xml to ActivityAthleteList.axml and from
> activity_athlete_twopane.xml to ActivityAthleteTwopane.axml.
>
> Unfortunately, I keep getting an error: Error: No resource found that matches
> the given name (at 'ActivityAthleteList' with value
> '@layout/ActivityAthleteTwopane').
>
> Does anybody know how to resolve this issue, or if this is even possible in
> MonoDevelop?
This is a bug.
Android doesn't like PascalCased resource names for filename-backed resources,
and @layout/ActivityAthleteTwopane is (presumably) file backed as
Resources\layout\ActivityAthleteTwopane.axml.
Mono for Android adds support for PascalCased resource names by lowercasing all
the resource names + references as part of the build process (see the files in
e.g. obj\Debug\res). Unfortunately I didn't know about the <item/> element, or
that the <item/> element could contain a resource reference. Result: <item/>
isn't fixed, and contains @layout/ActivityAthleteTwopane instead of
@layout/activityathletetwopane.
The workaround? Use the "internal" name, @layout/activityathletetwopane.
- Jon
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid