我是 xamarin 表单的新手,如何创建 Tabview,TabViewItems 应该居中对齐,在 xamarin 表单中使用 communityToolkit,想要创建如下视图下面是代码:
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:converter="clr-namespace:UIControls.Tabs"
xmlns:xct="clr-namespace:Xamarin.CommunityToolkit.UI.Views;assembly=Xamarin.CommunityToolkit"
x:Class="UIControls.Tabs.BottomTabs">
<converter:CustomTabView IsSwipeEnabled="True"
TabStripPlacement="Bottom"
SelectedIndex="0"
Style="{StaticResource TabViewStyle}"
HorizontalOptions="FillAndExpand">
<converter:CustomTabViewItem Text="Configuration"
Style="{StaticResource TabsItemStyle}"
IsSelected="True"
Icon="ic_router.png">
<xct:TabViewItem.Content>
<StackLayout>
<Label Text="TAB 1" />
</StackLayout>
</xct:TabViewItem.Content>
</converter:CustomTabViewItem>
<converter:CustomTabViewItem
Text="Monitoring"
Style="{StaticResource TabsItemStyle}"
Icon="ic_router.png">
<xct:TabViewItem.Content>
<ContentView />
</xct:TabViewItem.Content>
</converter:CustomTabViewItem>
<converter:CustomTabViewItem
Icon="ic_router.png"
Text="Diagnostics"
Style="{StaticResource TabsItemStyle}">
<xct:TabViewItem.Content>
<ContentView />
</xct:TabViewItem.Content>
</converter:CustomTabViewItem>
</converter:CustomTabView>
</ContentPage>