.NET Maui Android App not showing Flyout Menus

Fritz Switzer 241 Reputation points
2023-08-04T21:52:36.5466667+00:00

In my Windows app, my Flyout Menus are showing up correctly and respond correctly when clicked, however, the Flyout Menus do not show up while using any Android Emulators.

Here is my xaml:

 <ContentPage.MenuBarItems>
        <MenuBarItem Text="New/Search">
        </MenuBarItem>

        <MenuBarItem Text="Visits">
            <MenuFlyoutSubItem Text="Sub1">
                <MenuFlyoutItem Text="Redmond, USA"
                                Command="{Binding ChangeLocationCommand}"
                                CommandParameter="Redmond" />
                <MenuFlyoutItem Text="London, UK"
                                Command="{Binding ChangeLocationCommand}"
                                CommandParameter="London" />
                <MenuFlyoutItem Text="Berlin, DE"
                                Command="{Binding ChangeLocationCommand}"
                                CommandParameter="Berlin" />
            </MenuFlyoutSubItem>
            <MenuFlyoutSeparator />
            <MenuFlyoutItem Text="Sub"
                            Command="{Binding AddLocationCommand}" />
            <MenuFlyoutItem Text="Edit Location"
                            Command="{Binding EditLocationCommand}" />
            <MenuFlyoutItem Text="Remove Location"
                            Command="{Binding RemoveLocationCommand}" />
        </MenuBarItem>

        <MenuBarItem Text="Records">
        </MenuBarItem>
    </ContentPage.MenuBarItems>
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,899 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Dave Gerding 10 Reputation points
    2023-09-01T00:11:23.81+00:00

    I can report the same problem, and it has followed me into my migration to using the latest .net 8 preview builds. Beautiful in windows. No show elements in Android. Specifically, out of 18 identical elements except for string formatting, only two elements show up. I have no idea why. But I will see if I can reproduce. It's been maddening.

    1 person found this answer helpful.

  2. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 35,806 Reputation points Microsoft Vendor
    2023-08-07T01:33:57.71+00:00

    Hello,

    In my Windows app, my Flyout Menus are showing up correctly and respond correctly when clicked, however, the Flyout Menus do not show up while using any Android Emulators.

    This is exactly what is expected, as MenuBarItem is a desktop app-only control.

    Please refer to Display a menu bar in a .NET MAUI desktop app for more details.

    A .NET Multi-platform App UI (.NET MAUI) menu bar is a container that presents a set of menus in a horizontal row, at the top of an app on Mac Catalyst and Windows.

    If you need to display the Flyout control on mobile, please refer to .NET MAUI Shell flyout for more details.

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.