Bug 30166 - Problem with NavigationBar.BarBackgroundColor on Lollipop
Summary: Problem with NavigationBar.BarBackgroundColor on Lollipop
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.3
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-05-16 17:00 UTC by Alessandro
Modified: 2017-07-04 10:33 UTC (History)
14 users (show)

Tags: ac android navigationpage
Is this bug a regression?: ---
Last known good build:

test (3.97 MB, application/zip)
2015-06-01 10:27 UTC, Alessandro

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Alessandro 2015-05-16 17:00:52 UTC
Only on Lollipop device I have this problem.
I have defined a HoloLight theme for my application.
I create a Navigation Page and change the BarBackgroundColor

	App.MainNavigationPage = new NavigationPage (new PageRilevazione (true)); //{BarBackgroundColor = Library.ColorXamarin, BarTextColor = Color.White};
	App.MainNavigationPage.BarBackgroundColor = Library.ColorXamarin;
	App.MainNavigationPage.BarTextColor = Color.White;


public static Color ColorXamarin {
				return Color.FromHex ("3498db");}

The first time I open the NavigationPage, the BarBackgroungColor is "Colorxxamarin", but If I close and reopen the NavigationBar,
the color became "gray".
if I pushAsync another page and then return to the root page, the MarBackgroundColor is ColorXamarin

Comment 1 Seth Rosetter 2015-05-27 13:26:02 UTC
Thank you for taking the time to submit the bug. We tried to reproduce the issue you reported but were unable given the description. If you could please attach a reproduction to the bug by starting with a clean Xamarin.Forms project and adding just the code necessary to demonstrate the issue we would very much appreciate it. We monitor recently touched NEEDS INFO bugs so we’ll notice you attached the reproduction we’ll take it from there. 

Warm regards,
Xamarin Forms Team
Comment 2 Alessandro 2015-05-27 19:14:57 UTC
I do an example in next days
Comment 3 Alessandro 2015-06-01 10:27:08 UTC
Created attachment 11403 [details]

Ok Jason
1- press open navpage
2- press logout
3- press open navpage
4- the navbar is grey

Comment 4 Seth Rosetter 2015-06-22 15:18:51 UTC
I have confirmed this against latest stable (1.4.2). Thank you for the concise reproduction.
Comment 5 Andrea Todeschini 2015-08-13 10:46:56 UTC
I have the same problem with previous version of Android (4.1+)
Comment 6 Alessandro 2016-04-29 13:36:10 UTC
There is an ETA about this bug?
Comment 7 Falko Schindler 2016-07-11 17:15:35 UTC
I just came up with this tiny example:

    MainPage = new NavigationPage(new ContentPage {
        Content = new Button {
            Text = "Logout",
            Command = new Command(o => MainPage.Navigation.PushModalAsync(new ContentPage {
                Content = new Button {
                    Text = "Login",
                    Command = new Command(obj => MainPage.Navigation.PopModalAsync()),
    }) {
        BarBackgroundColor = Color.Red,

"Logout" pushes a new modal page with a "Login" button.
"Login" pops the modal page. But the re-appearing navigation page has a different bar background color.
Comment 8 Falko Schindler 2016-07-11 17:35:54 UTC
I found a rather lean workaround. Put this into your MainActivity:

    Xamarin.Forms.Application.Current.ModalPopping += (sender, e) => ActionBar.SetBackgroundDrawable(new ColorDrawable(Color.Red.ToAndroid()));

(And replace Red with the color of your choice.)
Comment 9 Jimmy [MSFT] 2016-12-09 23:05:46 UTC
This issue is still present with Forms
Comment 10 Samantha Houts [MSFT] 2017-03-16 01:13:00 UTC
Comment 11 Rui Marinho 2017-04-11 09:49:23 UTC
Should be fixed on 2.3.5-pre1
Comment 12 Saurabh Paunikar 2017-07-04 10:33:28 UTC
Verified on Xamarin.Forms Version