Search code examples
androidxamarinxamarin.formsandroid-toolbaroverflow-menu

How to set Overflow Menu position in Xamarin.Forms?


I'm working on Xamarin.Forms project and my Overflow Menu is covering the Toolbar control when it is opened on Android device.

Usually I'm able to solve it by seting overlapAnchor in actionOverflowMenuStyle to false like this:

<item name="overlapAnchor">false</item>

but in this case it doesn't work any more. Is there any other solution?


Solution

  • The solution was to set appcompat theme for parent attribute in overflow style

      <style name="YourOverflowStyle" parent="Theme.AppCompat.NoActionBar">
        <item name="overlapAnchor">false</item>
        <item name="android:overlapAnchor">false</item>
      </style>
    

    And you should also reference this style in your Toolbar like this

    android:theme="@style/YourOverflowStyle"