我使用默认应用程序在 Visual Studio 中创建了一个新的 MAUI 应用程序。我试图在底部添加一个 TabBar,但它总是出现在顶部(参见屏幕截图)。我见过的所有示例和我读过的文档都表明它应该位于底部。我究竟做错了什么?这是在 Windows 上。
这是AppShell.xaml
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="letseat.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:letseat"
>
<TabBar Route="Home">
<Tab Icon="dotnet_bot.png" Title="Main">
<ShellContent ContentTemplate="{DataTemplate local:MainPage}"/>
</Tab>
<Tab Icon="dotnet_bot.png" Title="Profile">
<ShellContent ContentTemplate="{DataTemplate local:ProfilePage}"/>
</Tab>
<Tab Icon="dotnet_bot.png" Title="Test">
<ShellContent ContentTemplate="{DataTemplate local:ProfilePage}"/>
</Tab>
</TabBar>
</Shell>
Run Code Online (Sandbox Code Playgroud)
以及结果 截图