Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
If I use FormsApplicationActivity over MainActivity the a Picker custom render work's fine, but if I change to the new FormsAppCompatActivity, the Renderer stops getting called, no one of their overriding methods.
A reproduction project would be appreciated in helping to investigate the issue.
Created attachment 14815 [details]
Hi Paul, sorry for being late. I have already attached the sample project.
Your sample project is missing the [ExportRenderer] attribute to wire up your custom renderer to the Xamarin.Forms type, but even then it won't work because in FormsAppCompatActivity.LoadApplication it will wipe out your registration on Xamarin.Forms.Picker (unless you reflect into FormsAppCompatActivity and set the private renderersAdded field to true).
Esteban, you need to change the state of this ticket back to NEW or Xamarin will not look at it again.
But please add the [ExportRenderer] first as Kelly explained.
Xamarin has to provide a solution which is not as tightly coupled as their current FormsAppCompatActivity.LoadApplication. E.g. move that if(!renderersAdded) to a separate virtual method or use the DependencyService to get the correct renderer.
For a component developer it is currently impossible to provide renderers which work on both the standard Android or AppCompat. E.g.: I wrote MR.Gestures.Button with a custom renderer which inherits from Xamarin.Android.Platform.Android.ButtonRenderer. But when my users use AppCompat, then it should actually inherit from Xamarin.Forms.Platform.Android.AppCompat.ButtonRenderer.
This is a duplicate of https://bugzilla.xamarin.com/show_bug.cgi?id=39847 and was fixed in version 2.3.0 (PR https://github.com/xamarin/Xamarin.Forms/pull/112).
*** This bug has been marked as a duplicate of bug 39847 ***