My Custom ButtonRenderer does not get called since my Activity inherits from FormsAppCompatActivity instead of FormsApplicationActivity
Is this a known issue?
My custom renderer:
[assembly: ExportRenderer (typeof (Button), typeof (ButtonCustomRenderer))]
namespace MyApp.Droid
{
public class ButtonCustomRenderer : ButtonRenderer
{
Android.Graphics.Typeface _typeFaceRegular = Android.Graphics.Typeface.CreateFromAsset (Android.App.Application.Context.Assets, "AbcTT-Regular_2_0.ttf");
protected override void OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs<Button> e)
{
base.OnElementChanged (e);
Control.SetTypeface (_typeFaceRegular, Android.Graphics.TypefaceStyle.Normal);
Control.StateListAnimator = null;
}
protected override void OnElementPropertyChanged (object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
base.OnElementPropertyChanged (sender, e);
}
}
}
I already tried to change my usings from:
using Xamarin.Forms.Platform.Android;
to:
using Xamarin.Forms.Platform.Android.AppCompat;