Created
March 4, 2019 14:17
-
-
Save jfversluis/4d7538e58357ee0a510d1c80829638f5 to your computer and use it in GitHub Desktop.
Set the UnselectedTabColor and SelectedTabColor in the iOS renderer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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