I am new to Xamarin Forms. I have made an Entry renderer for Android. The custom renderer works fine on Android emulator but the app crashes when i deploy it on real android device. Any suggestions about that !
Here is the Code!
Entry Class
namespace ARO
{
public class Rounded_Entry: Entry
{
}
}
Android Renderer Class
[assembly:ExportRenderer(typeof(Rounded_Entry),typeof(RoundedEntryRendererAndroid))]
namespace ARO.Droid {
public class RoundedEntryRendererAndroid : EntryRenderer
{
public RoundedEntryRendererAndroid(Context context) : base(context)
{
}
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
{
base.OnElementChanged(e);
if (e.OldElement == null)
{
//Control.SetBackgroundResource(Resource.Layout.layout1);
var gradientDrawable = new GradientDrawable();
gradientDrawable.SetCornerRadius(60f);
gradientDrawable.SetStroke(5, Android.Graphics.Color.DeepPink);
gradientDrawable.SetColor(Android.Graphics.Color.LightGray);
Control.SetBackground(gradientDrawable);
Control.SetPadding(50, Control.PaddingTop, Control.PaddingRight,
Control.PaddingBottom);
}
}
}
}