From cbee9cbc3c3cf89b886e5939e8f52701ba0dd8a2 Mon Sep 17 00:00:00 2001 From: Gerald Versluis Date: Thu, 22 Aug 2019 13:17:26 +0200 Subject: [PATCH] Update SafeShellTabBarAppearanceTracker.cs (#7165) fixes #6739 --- .../Renderers/SafeShellTabBarAppearanceTracker.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Xamarin.Forms.Platform.iOS/Renderers/SafeShellTabBarAppearanceTracker.cs b/Xamarin.Forms.Platform.iOS/Renderers/SafeShellTabBarAppearanceTracker.cs index 33cde3d..ed702fb 100644 --- a/Xamarin.Forms.Platform.iOS/Renderers/SafeShellTabBarAppearanceTracker.cs +++ b/Xamarin.Forms.Platform.iOS/Renderers/SafeShellTabBarAppearanceTracker.cs @@ -29,20 +29,29 @@ namespace Xamarin.Forms.Platform.iOS var titleColor = appearanceElement.EffectiveTabBarTitleColor; var tabBar = controller.TabBar; + bool operatingSystemSupportsUnselectedTint = Forms.IsiOS10OrNewer; if (_defaultTint == null) { _defaultBarTint = tabBar.BarTintColor; _defaultTint = tabBar.TintColor; - _defaultUnselectedTint = tabBar.UnselectedItemTintColor; + + if (operatingSystemSupportsUnselectedTint) + { + _defaultUnselectedTint = tabBar.UnselectedItemTintColor; + } } if (!backgroundColor.IsDefault) tabBar.BarTintColor = backgroundColor.ToUIColor(); if (!titleColor.IsDefault) tabBar.TintColor = titleColor.ToUIColor(); - if (!unselectedColor.IsDefault) - tabBar.UnselectedItemTintColor = unselectedColor.ToUIColor(); + + if (operatingSystemSupportsUnselectedTint) + { + if (!unselectedColor.IsDefault) + tabBar.UnselectedItemTintColor = unselectedColor.ToUIColor(); + } } public void UpdateLayout(UITabBarController controller) -- 2.7.4