0
votes

I'm using Visual Studio and Xamarin Forms I have a Content Page with an action bar and a toolbar button that appears in the overflow popup menu with the following code.

<ContentPage.ToolbarItems>
    <ToolbarItem Text="Sample 01" Order="Secondary" Priority="0" />
</ContentPage.ToolbarItems>

I would like to change the color of the background of the popup as well as the color of the text of the toolbar items.

Currently and because I have set in the styles.xml of the Android solution, the TextColor to be black, both the background color and the items appear in black.

<item name="android:textColor">@color/primary_text</item>

Setting the background to white with the following will not fix the issue because this will alter the appearance of other parts of the app.

<item name="android:colorBackground">#FFFFFF</item>

My question is how to set the background color of the popup menu of the action bar specifically without affecting other elements of the app?

1
You set these values for android:popupMenuStyle?Cheesebaron
The suggestions in the post that you mentioned, didn’t work for me.Dimitris

1 Answers

0
votes

The way to change the background color of the overflow popup is by inserting the following line in the style.xml (Android project)

<item name="android:itemBackground">#FFFFFF</item>

I found the answer in the following link https://forums.xamarin.com/discussion/99515/how-to-make-a-toolbar-like-whats-app-toolbar