[Mono-list] Mono for Android: how to use a non-standard widget from axml?
Dimitar Dobrev
dpldobrev at yahoo.com
Mon Mar 11 14:52:02 UTC 2013
I had already tried that but I kept getting "Error 36 Error parsing XML: unbound prefix .../Resources/layout/locationslayout.xml" in Visual Studio. I use Mono for Android 4.4.55.Any other ideas?
________________________________
From: Jonathan Pryor <jonpryor at vt.edu>
To: Dimitar Dobrev <dpldobrev at yahoo.com>
Cc: "mono-list at lists.ximian.com" <mono-list at lists.ximian.com>
Sent: Monday, March 11, 2013 3:53 PM
Subject: Re: [Mono-list] Mono for Android: how to use a non-standard widget from axml?
On Mar 11, 2013, at 8:07 AM, Dimitar Dobrev <dpldobrev at yahoo.com> wrote:
> I have a class in my project that is a widget. I know I can use it in code as a workaround but can I use it in axml as well? If so, how do I configure it?
The monodroid list [0] or the forums [1] would be a better place to ask.
To refer to a type in a .axml file, you must use either the fully-qualified C# type name (case-sensitive), or the fully-qualified Android Callable Wrapper type name [2, 3]:
https://github.com/xamarin/monodroid-samples/blob/master/GLCube/Resources/layout/main.xml#L21
https://github.com/xamarin/monodroid-samples/blob/master/GLCube/PaintingView.cs#L16
The above sample is old, so it's using the Android Callable Wrapper type name, but it could instead use the fully-qualified C# type name instead:
<Mono.Samples.GLCube.PaintingView
android:id="@+id/paintingview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
- Jon
[0]: http://lists.ximian.com/mailman/listinfo/monodroid
[1]: http://forums.xamarin.com/categories/android
[2]: http://forums.xamarin.com/discussion/comment/6912/#Comment_6912
[3]: http://docs.xamarin.com/guides/android/advanced_topics/java_integration_overview/android_callable_wrappers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20130311/066553fe/attachment.html>
More information about the Mono-list
mailing list