So, I have a
UIAlertController action sheet that I display using iOS-only code in my cross-platform Xamarin.Forms app. The action sheet is displayed when a
Xamarin.Forms.ToolbarItem is tapped by the user. When on iPad, the
UIAlertController containing the action sheet needs to have its
UIPopoverPresentationController.BarButtonItem set to the menu item that caused it to appear, or I have to manually specify a location on screen where I want the action sheet to appear.
Is there no way of converting a
Xamarin.Forms.ToolbarItem into its corresponding
I've tried for hours by intercepting calls to
NavigationRenderer to no avail, since the
ToolbarItems properties of the respective native views are never set. I can see the
Xamarin.Forms.ToolbarItems I provided at
Xamarin.Forms.Page construction, however. I cannot use
Platform.GetRenderer() as it requires a
Xamarin.Forms.ToolbarItem doesn't implement.
I also looked at
Xamarin.Forms.Platform.iOS.ToolbarItemExtensions.ToUIBarButtonItem, which gives me a proper
UIBarButtonItem from a
Xamarin.Forms.ToolbarItem, but the provided item is a new such, and has no correspondence on screen. Using the returned item as a value for
UIPopoverPresentationController.BarButtonItem causes the application to crash.
Any other ideas?