summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.iOS
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.iOS')
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs16
1 files changed, 9 insertions, 7 deletions
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs
index 0d6601c7..18000b7f 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs
@@ -418,7 +418,7 @@ namespace Xamarin.Forms.Platform.iOS
UpdateTint();
if (e.PropertyName == NavigationPage.BarBackgroundColorProperty.PropertyName)
UpdateBarBackgroundColor();
- else if (e.PropertyName == NavigationPage.BarTextColorProperty.PropertyName)
+ else if (e.PropertyName == NavigationPage.BarTextColorProperty.PropertyName || e.PropertyName == PlatformConfiguration.iOSSpecific.NavigationPage.StatusBarTextColorModeProperty.PropertyName)
UpdateBarTextColor();
else if (e.PropertyName == VisualElement.BackgroundColorProperty.PropertyName)
UpdateBackgroundColor();
@@ -572,23 +572,25 @@ namespace Xamarin.Forms.Platform.iOS
NavigationBar.TitleTextAttributes = titleAttributes;
}
+ var statusBarColorMode = (Element as NavigationPage).OnThisPlatform().GetStatusBarTextColorMode();
+
// set Tint color (i. e. Back Button arrow and Text)
if (Forms.IsiOS7OrNewer)
{
- NavigationBar.TintColor = barTextColor == Color.Default
+ NavigationBar.TintColor = barTextColor == Color.Default || statusBarColorMode == StatusBarTextColorMode.DoNotAdjust
? UINavigationBar.Appearance.TintColor
: barTextColor.ToUIColor();
}
- if (barTextColor.Luminosity > 0.5)
+ if (statusBarColorMode == StatusBarTextColorMode.DoNotAdjust || barTextColor.Luminosity <= 0.5)
{
- // Use light text color for status bar
- UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;
+ // Use dark text color for status bar
+ UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.Default;
}
else
{
- // Use dark text color for status bar
- UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.Default;
+ // Use light text color for status bar
+ UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;
}
}