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.
.NET Maui Android App not showing Flyout Menus
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>
2 answers
Sort by: Most helpful
-
-
Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 45,411 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.