Skip to content

Instantly share code, notes, and snippets.

@jfversluis
Created March 4, 2019 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfversluis/4d7538e58357ee0a510d1c80829638f5 to your computer and use it in GitHub Desktop.
Save jfversluis/4d7538e58357ee0a510d1c80829638f5 to your computer and use it in GitHub Desktop.
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