Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Set the UnselectedTabColor and SelectedTabColor in the iOS renderer
void UpdateSelectedTabColors()
{
if (Tabbed == null || TabBar == null || TabBar.Items == null)
return;
if (Tabbed.IsSet(TabbedPage.SelectedTabColorProperty) && Tabbed.SelectedTabColor != Color.Default)
TabBar.SelectedImageTintColor = Tabbed.SelectedTabColor.ToUIColor();
else
TabBar.SelectedImageTintColor = null;
if (!Forms.IsiOS10OrNewer)
return;
if (Tabbed.IsSet(TabbedPage.UnselectedTabColorProperty) && Tabbed.UnselectedTabColor != Color.Default)
TabBar.UnselectedItemTintColor = Tabbed.UnselectedTabColor.ToUIColor();
else
TabBar.UnselectedItemTintColor = null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment