Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 58373 on
Developer Community or GitHub if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
# Steps to reproduce
Attempt to follow iOS-specific solutions by manually setting everything in AppDelegate's FinishedLaunching() as described on http://motzcod.es/post/110755300272/ios-tip-change-status-bar-icon-text-colors
I'd like to set NavigationBar's text color to white and the tint color to orange, so that buttons are a different color than the text.
This seems like standard behavior on both Android and iOS, so I don't know why it's difficult with Xamarin.Forms.
If I set the `BarTextColor = Color.White` for the NavigationPage, then they all get set to white (along with the status bar text).
# Expected behavior
Should be able to change status bar style with
UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;
# Actual behavior
This doesn't work because it gets overridden with the default NavigationRenderer:
There's no way to disable the override, since setting StatusBarTextColorMode.DoNotAdjust will result in the "Default" style with black text.
# Supplemental info (logs, images, videos)
# Test environment (full version information)
To clarify, by using AppDelegate and not setting any parameters on the NavigationPage, I'm able to style both the text and tint separately:
UINavigationBar.Appearance.TintColor = accent;
UINavigationBar.Appearance.TitleTextAttributes = new UIStringAttributes
ForegroundColor = UIColor.White
Setting the BarTextColor property on the NavigationPage, however, will override both of these values.
Similarly, NOT setting the BarTextColor will result in the status bar style getting overridden with UIStatusBarStyle.Default.
Perhaps the L609 ought to be changed from:
if (statusBarColorMode == StatusBarTextColorMode.DoNotAdjust || barTextColor.Luminosity <= 0.5)
if (statusBarColorMode == StatusBarTextColorMode.DoNotAdjust || NavigationBar.TintColor.Luminosity <= 0.5)
Or, possibly, it should be refactored into UpdateBarBackgroundColor() to only use black text on light backgrounds. (And white text on darker backgrounds.)
Sorry for the additional comments... Last idea:
Or maybe, rather than a StatusBarTextColorMode.DoNotAdjust (which doesn't work as the name implies... since it actually DOES still adjust it back to the default), we should just be able to set the value with a platform-specific Black or White.
*** Bug 58374 has been marked as a duplicate of this bug. ***
TintColor.Luminosity <= 0.5 is arbitrary and extremely unhelpful. It basically makes it impossible to have many (valid and visually appealing) schemes in a Xamarin.Forms app. Please remove it and create customisation points instead that allow us to properly set both the font colour and the title bar colour independently of each other.
Just to clarify:
You can already set the Title Bar Color and Font Color separately.
Although the Font Color sets both the "Tint" color of buttons (and the back navigation) AND the title text. (Note: By default the title text is black and "Tint" color is blue on a white navigation bar.)
The status bar text, however, only lets you change between black and white.
From this perspective, the use of "Luminosity" isn't necessarily a bad decision, as it will attempt to go close to whatever text color you use.
I do agree that it might be best to let the user choose, which they could do by having "StatusBarTextColorMode.DoNotAdjust" simply not mess with changes (currently it forces the "default" of black).
In which case you ought to be able to make adjustments in the AppDelegate.