Closed eko94 closed 4 years ago
I'm trying to create a custom renderer for this plugin on Android but CustomRenderer file is not loading, therefore not changing the control.
Custom renderer loading and taking effects on changes made.
Custom renderer not loading and not taking any effect on changes made.
The next code is in Android project:
using Xamarin.Forms.Platform.Android; using dotMorten.Xamarin.Forms.Platform.Android; using NativeAutoSuggestBox = dotMorten.Xamarin.Forms.Platform.Android.AndroidAutoSuggestBox; [assembly: ExportRenderer(typeof(Test.Droid.Renderers.CustomAutoSuggestBox), typeof(Test.Droid.Renderers.CustomAutoSuggestBoxRenderer))] namespace Test.Droid.Renderers { public class CustomAutoSuggestBox : AutoSuggestBox { } public class CustomAutoSuggestBoxRenderer : AutoSuggestBoxRenderer { public CustomAutoSuggestBoxRenderer(global::Android.Content.Context context) : base(context) { } protected override void OnElementChanged(ElementChangedEventArgs<AutoSuggestBox> e) { base.OnElementChanged(e); GradientDrawable gd = new GradientDrawable(); gd.SetColor(global::Android.Graphics.Color.Red); this.Control.SetBackground(gd); } } }
Description
I'm trying to create a custom renderer for this plugin on Android but CustomRenderer file is not loading, therefore not changing the control.
Expected Behavior
Custom renderer loading and taking effects on changes made.
Actual Behavior
Custom renderer not loading and not taking any effect on changes made.
Basic Information
Reproduction Code
The next code is in Android project: