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

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


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

Description Alessandro 2015-05-16 17:00:52 UTC
Hi.
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 {
			get{ 
				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


http://www.screencast.com/t/TLUNSXuH
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]
test

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

Alessandro
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 2.3.3.175
Comment 10 Samantha Houts [MSFT] 2017-03-16 01:13:00 UTC
https://github.com/xamarin/Xamarin.Forms/pull/753
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 2.3.5.256-pre5

Note You need to log in before you can comment on or make changes to this bug.