Setting background color of xamarin toolbaritems

4.5k Views Asked by At

I'm using Xamarin's ToolbarItems class with XAML:

<ContentPage.ToolbarItems>
    <ToolbarItem Text="Sent Messages" Clicked="ToolbarItem_OnClicked" 
    Order="Primary" Priority="0" />
</ContentPage.ToolbarItems>

Is there a way to change the background color and text color of all the toolbaritems?

1

There are 1 best solutions below

1
On

When creating a navigation page you can change the background color, and text color of the ToolbarItems as follows.

new NavigationPage (new MyPage ()) {
    BarBackgroundColor = Color.Green, BarTextColor = Color.White   
};

Hope this helps.