I have been trying to insert a search control in a toolbar. I understand that in order to do this I need to write a custom renderer. I have based myself on the following:
https://codetraveler.io/2019/10/05/adding-a-search-bar-to-xamarin-forms-navigationpage/
With the complete solution found here:
https://github.com/brminnick/GitTrends
I have integrated the relevant portions of the above solution into my project. However despite my best efforts have not been able to get the search icon to appear in my toolbar. My code is displayed below. When I debug the SearchPageRenderer.cs in the android project, OnElementChanged gets called which then calls AddSearchToToolbar. This behavior is correct. In AddSearchToToolbar all the if statements in it check out which is also correct. Still no search icon appears in the toolbar. Its been a week and i'm all out of ideas at this point.
If there are other more simple solutions to implementing this, i'm all ears. This has been my first (and very unpleasent) experience with custom renderers.
My relevant code is viewable in the attachment.