嗨,我是 Xamarin Forms 的新手,我正在使用 BottomBarPage,现在我需要一个包含不同项目的自定义工具栏,正如您在代码中看到的那样,我成功添加了 ToolbarItem,我的疑问是,如何更改工具栏背景颜色?我在 xf:BottomBarPage 中尝试了 x:BackgroundColor 但没有用。有什么建议吗?
<?xml version="1.0" encoding="utf-8" ?>
<xf:BottomBarPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MyProject.Views.StartPage"
xmlns:xf="clr-namespace:BottomBar.XamarinForms;assembly=BottomBar.XamarinForms"
xmlns:Views="clr-namespace:MyProject.Views;assembly=MyProject"
x:Name="TabMenu">
<xf:BottomBarPage.ToolbarItems x:BackgroundColor="#D60000">
<ToolbarItem Name="User" Order="Primary" Icon="home.png" Text="Item 1" Priority="0" Clicked="User_Clicked"/>
<!--<ToolbarItem Name="MenuItem2" Order="Primary" Icon="Xamarin.png" Text="Item 2" Priority="1" />-->
</xf:BottomBarPage.ToolbarItems>
<xf:BottomBarPage.Children>
<Views:MainPage
ClassId="Home"
Title="Page1"
Icon="Page1.png"
xf:BottomBarPageExtensions.TabColor="#D60000"/>
<Views:MainPage
Title="Page2"
Icon="Page2.png"
xf:BottomBarPageExtensions.TabColor="#D60000"/>
<Views:Graphs
Title="Page3"
Icon="Page3.png"
xf:BottomBarPageExtensions.TabColor="#D60000"/>
<Views:MainPage
Title="Page4"
Icon="Page4.png"
xf:BottomBarPageExtensions.TabColor="#D60000"/>
<Views:Info
Title="Page5"
Icon="Page5.png"
xf:BottomBarPageExtensions.TabColor="#D60000"/>
</xf:BottomBarPage.Children>
</xf:BottomBarPage>
蓝色条是我要更改 颜色工具栏的背景颜色
现在使用 TabbedPage,声明是: Tabbed Page
但是顶部栏的颜色仍然是蓝色,我该如何更改? 顶部工具栏