我想把MenuBarItem放在ContentPage标题下面。有可能吗?
注意:.NET多平台应用程序UI (.NET MAUI)菜单栏是一个容器,它显示一组菜单在水平行中,在Mac催化剂和.NET上的应用程序顶部。
这里是我的页面的代码
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MPC_MassPropertiesCalculator_MAUIapp.Views.MPCFileDemo"
Title="MPC - File Demo">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
<RowDefinition Height="*" />
<RowDefinition Height="100" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
</Grid>
<ContentPage.MenuBarItems>
<MenuBarItem Text="Open MPC File" Grid.Row="1">
</MenuBarItem>
<MenuBarItem Text="Compare" Grid.Row="1">
</MenuBarItem>
</ContentPage.MenuBarItems>
</ContentPage>这里是Windows 上的输出窗口

发布于 2022-11-14 07:43:15
根据Microsoft文档的说法,菜单栏是一个容器,它在桌面应用程序顶部的水平行中显示一组菜单,而不提供更改其位置的方法。
https://stackoverflow.com/questions/74411361
复制相似问题