如何更改Xamarin.Forms中SECONDARY工具栏的颜色?

问题描述 投票:5回答:1

当前,我使用App.xaml.cs类中的这段代码设置主工具栏的背景色:

//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);

navigationPage PRIMARY工具栏正确更改其颜色。但是SECONDARY工具栏不会更改其默认颜色(灰色),并且我找不到任何方法或属性可以对其进行更改。如何更改辅助工具栏的背景颜色?

c# xaml xamarin xamarin.forms navigationbar
1个回答
0
投票

您找到解决方案了吗?我也在寻找一种将图标添加到辅助菜单并使之更加时尚的方法。

© www.soinside.com 2019 - 2024. All rights reserved.