What I have:
I have a Xamarin.Forms
app with a ToolBar
(ActionBar
on Android, Navigation Bar
on iOS). Within the ToolBar
I have a ToolBarItem
to delete something.
What I want:
For the ToolBarItem
mentioned above I want to use the native platform icons (f.e. a trash can).
My question:
What is the proper way to achieve this? It seems that the only way to do this is to add and load separate png-files as described here. For Android this is not such a big deal I can officially download the icon files from Google's developer page. For iOS this is not possible.
Currently this looks to be almost impossible to override. Looking at the source for
ToolbarRenderer
you can see theUpdateItems
method. This assumes that all of the toolbar items are of typeToolbarItem
and it does not invoke a custom renderer for them, instead calling through directly to an extension method that convertsToolbarItem
values intoUIBarButtonItem
s containing aUIImage
.