I'm trying to change the colour of the unselected icons from the TabbedPage.
I have a custom TabbedRenderer :
public class CustomTabbedPage : TabbedRenderer
{
public override void ViewWillAppear(bool animated)
{
if (TabBar == null) return;
if (TabBar.Items == null) return;
var tabs = Element as TabbedPage;
if (tabs != null)
{
for (int i = 0; i < TabBar.Items.Length; i++)
{
UpdateItem(TabBar.Items[i], tabs.Children[i].Icon);
}
}
base.ViewWillAppear(animated);
}
private void UpdateItem(UITabBarItem item, string icon)
{
if (item == null)
return;
try
{
icon = icon.Replace(".png", " Filled.png");
if (item == null) return;
if (item.SelectedImage == null) return;
if (item.SelectedImage.AccessibilityIdentifier == icon) return;
item.SelectedImage = UIImage.FromBundle(icon);
item.SelectedImage.AccessibilityIdentifier = icon;
}
catch (Exception ex)
{
Console.WriteLine("Unable to set selected icon: " + ex);
}
}
}
I have managed to change the selected item text colour and the unselected items text colour, but not the icon colours.
Thank you!