Bug 21536 - TabbedPage Actionbar background color
Summary: TabbedPage Actionbar background color
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.2
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-07-23 04:14 UTC by zapzqc@qq.com
Modified: 2016-03-15 19:33 UTC (History)
5 users (show)

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


Attachments
Source code Of Project. (6.82 MB, application/octet-stream)
2014-08-19 11:19 UTC, Arpit Jha
Details


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:
Status:
RESOLVED FIXED

Description zapzqc@qq.com 2014-07-23 04:14:44 UTC
I custom the Actionbar color .the code is:

var mainTab = new TabbedPage() { Children = { ViewFactory.CreatePage<FirstPageViewModel>(), new SecondPage(),            ViewFactory.CreatePage<ThirdPageViewModel>() }, Title = "MobileOffice" };
   var mainPage = new NavigationPage(mainTab) { };
        mainPage.BarBackgroundColor = Color.Blue;
        mainPage.BarTextColor = Color.White;
        return mainPage;

when the application run,the color of the Actionbar Is Blue。

but when I change the tabs in TabbedPage , the background color of Actionbar back to default color。
Comment 1 Arpit Jha 2014-08-19 11:19:18 UTC
Created attachment 7721 [details]
Source code Of Project.

I have checked this issue and not able to reproduce this issue.I have followed the following steps to reproduce this issue.

1.Create an Mobile Apps Portable Forms application.
2. I have written a code to create Tabbed page and Set the background color:Purple of Tabbed Page.
4. Run the Application.
5. Now I tab on pages, I am able to see the purple color on all tabbed pages.

ScreenCast regarding same : http://screencast.com/t/QignO0Ibwl

Environment  Info : 
XVS 3.5.38.0
Xamarin.Forms Version:  1.2.2.6243

Please let Me know if i missed anything to reproduce this issue.
Comment 2 Keta 2014-09-15 16:21:49 UTC
I got this same problem. The solution is to give it a Title. The actual TabbedPage control. Give that a title, and the color will remain.

But yes, this is indeed a bug.
Comment 3 Seth Rosetter 2014-09-30 14:48:28 UTC
Keta or zapzqc,

Can you provide more context (project / sample code)? I also am unable to reproduce this. This works as expected for me even when the TabbedPage has no Title set. Also, what device / emulator are you experiencing this behavior on?

The following code works for me.

        public class NavPage : NavigationPage
	{
		public NavPage ()
		{
			BarTextColor = Color.White;
			BarBackgroundColor = Color.Blue;

			Navigation.PushAsync (new TabPage ());
		}

		private class TabPage : TabbedPage
		{
			public TabPage ()
			{
				//Title = "Tabbed Page Title";
				Children.Add (new Tab ("Page 1") { Title = "Tab 1" });
				Children.Add (new Tab ("Page 2") { Title = "Tab 2" });
			}
		}
		
		private class Tab : ContentPage
		{
			public Tab (string pageText)
			{
				Content = new Label { Text = pageText };
			}
		}
	}

Thanks!
Comment 4 Jason Smith [MSFT] 2016-03-15 19:33:09 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we no longer believe it affects the current version of Xamarin.Forms when using the AppCompat backend. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.
 
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d

Warm regards,
Xamarin Forms Team