paulina
paulina

Reputation: 209

Setting background color of xamarin toolbaritems

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?

Upvotes: 3

Views: 4581

Answers (1)

John
John

Reputation: 31

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.

Upvotes: 3

Related Questions