I'm using Xamarin Forms Shell TabBar and i'm working into renderers to customize this tabbar, i want to change icon when a tab is selected.
I found this tutorial : https://montemagno.com/tintcolor-selectedimage-xamarin-forms-ios/
I'm trying to achieve the "Selected TabItem Image" part where i have for each tab an icon for selected state and an icon for unselected state.
My issue is this tutorial using classic TabbedPage renderer where i am using a IShellTabBarAppearanceTracker (because i am using shell) and i can't access the tabs.Children[i].Icon
property, only the controller.TabBar
in public void SetAppearance(UITabBarController controller, ShellAppearance appearance)
method.
So i have no way to access current tab icon's name to perform the following code :
icon = icon.Replace(".png", "_selected.png");
if(item?.SelectedImage?.AccessibilityIdentifier == icon)
return;
item.SelectedImage = UIImage.FromBundle(icon);
item.SelectedImage.AccessibilityIdentifier = icon;
is there a way to do it ? Or do we have to do it differently ?