How to change the color of the SECONDARY toolbar in Xamarin.Forms?

Currently, I have set the main color of the toolbar using this code in the App.xaml.cs class:

//SET PRIMARY TOOLBAR COLOR
Current.Resources = new ResourceDictionary ();
Color xamarin_color = Color.FromHex ("#3498db");            
var navigationStyle = new Style (typeof (NavigationPage));
var barBackgroundColorSetter = new Setter { Property = NavigationPage.BarBackgroundColorProperty, Value = xamarin_color };          
navigationStyle.Setters.Add (barBackgroundColorSetter);         
Current.Resources.Add (navigationStyle);

The navigationPage PRIMARY toolbar changes color correctly. But the SECONDARY toolbar does not change its default color (gray), and I cannot find any method or property to change it. How can I change the background color of an additional toolbar?

+5
source share

Source: https://habr.com/ru/post/1654903/


All Articles