I have a list of image in my xaml on pcl project when I test my app in my samsumg galaxy s5 device I do this: I enter in the page of the list, then I press the back button o
You've named your class LabelRenderer
, which already exists in the Xamarin.Forms.Platform.Android
namespace.
In the assembly attribute, typeof(LabelRenderer)
is equivalent to typeof(Xamarin.Forms.Platform.Android.LabelRenderer)
, but we need it to be typeof(neoFly_Montana.Droid.LabelRenderer)
.
An easy way to avoid these namespace conflicts going forward is to use a unique class name, like NeoFly_MontanaLabelRenderer
.
And when using Xamarin.Forms v2.5+, we need to use an overloaded Constructor, which I've added below.
using System;
using Android.Runtime;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
using neoFly_Montana.Droid;
[assembly: ExportRenderer(typeof(Xamarin.Forms.Label), typeof(NeoFly_MontanaLabelRenderer))]
namespace neoFly_Montana.Droid
{
public class NeoFly_MontanaLabelRenderer : Xamarin.Forms.Platform.Android.LabelRenderer
{
}
}
using System;
using Android.Runtime;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
using neoFly_Montana.Droid;
[assembly: ExportRenderer(typeof(Xamarin.Forms.Label), typeof(NeoFly_MontanaLabelRenderer))]
namespace neoFly_Montana.Droid
{
public class NeoFly_MontanaLabelRenderer : Xamarin.Forms.Platform.Android.LabelRenderer
{
public NeoFly_MontanaLabelRenderer(Context context) : base(context)
{
}
}
}