我需要在TabBar(或FlyoutItem)中添加一个类似于shell中MenuItem的项目(只是没有ContentPage的按钮)。
<FlyoutItem>
<ShellContent Route="kitties" Title="Kitties" Icon="cat.png" ContentTemplate="{DataTemplate views:GeneralAnimalPage}"/>
<!-- something like this -->
<SomeItem Title="Press me" Click="Click_Handler"/>
<!-- or this -->
<Tab Title="Press me" Command="{Binding MyCommand}"/>
<!-- or even this: no contenttemplate, just routing! -->
<ShellContent Title="Press me" Route="myroutepage1"/>
</FlyoutItem>
领先:我将需要在codebehind中以编程方式添加它,并且条目必须在底部栏中。
1条答案
按热度按时间gijlo24d1#
替代但实际有效的方法:
您可以使用BindableLayout和RadioButton编写自己的TabBar。
好的开始:https://dev.to/davidortinau/making-a-tabbar-or-segmentedcontrol-in-net-maui-54ha