我有一个有四页的应用程序,我希望它看起来与我的(非 Xamarin)iOS 应用程序相似,因此在底部有工具栏。这是我的 MainPage.xaml 文件:
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:XaBLE1"
x:Class="XaBLE1.MainPage"
Title="Safe-T Sim" HeightRequest="768" WidthRequest="512"
BarBackgroundColor="#F1F1F1"
BarTextColor="Gray"
xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
android:TabbedPage.ToolbarPlacement="Bottom"
android:TabbedPage.BarItemColor="#666666"
android:TabbedPage.BarSelectedItemColor="Black"
>
<NavigationPage Title="Test" Icon="ElectTest.png"
HasNavigationBar="False">
<x:Arguments>
<local:TestPage />
</x:Arguments>
</NavigationPage>
<NavigationPage Title="Review" Icon="Review.png"
HasNavigationBar="False">
<x:Arguments>
<local:ReviewPage />
</x:Arguments>
</NavigationPage>
<NavigationPage Title="Setup" Icon="Gear.png"
HasNavigationBar="False">
<x:Arguments>
<local:SetupPage />
</x:Arguments>
</NavigationPage>
<NavigationPage Title="Info" Icon="Info.png"
HasNavigationBar="False">
<x:Arguments>
<local:InfoPage />
</x:Arguments>
</NavigationPage>
</TabbedPage>
我不关心 Oreo 上当前的外观,即使选定的页面选项卡变大并放置标题,将其他选项卡推到一边并删除页面标题。
反正有没有禁用这种行为,让它只是 4 个标签。请注意,如果有 3 个选项卡,则不会发生此行为 - 图标和文本只有变暗和轻微放大,但两者都是可见的。
编辑:我尝试了评论中建议的答案,但如前所述,我不确定这是否试图解决相同的问题,并且无论如何都不会改变行为。