.NET Maui Flyout Menus not working

Fritz Switzer 321 Reputation points
2023-08-04T21:58:20.9333333+00:00

My .NET Maui FlyoutMenus are not working with Android Emulator. The code works correctly as expected using Windows. Here is my code:

 <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>
Developer technologies | .NET | .NET MAUI
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2023-08-07T02:31:21.2933333+00:00

    Hello,

    Your code is related to the MenuBarItem, MenuBarItem do not support for the android platform. It supports for Mac Catalyst and Windows. See MenuBarItem document

    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.

    Best Regards,

    Leon Lu


    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.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.