在xamarin forms shell中,如何在进入下一页时不显示底部标签
In the xamarin forms shell, how do I not display the bottom tab when I go to the next page
在这个例子中,
enter image description here
点击商品item跳转到详情页,
enter image description here
但我不想在总页上显示底部标签。我用了[shell。当前的。导航。 Pushmodal async],结果是没有实现顶部导航栏。现在想请教如何跳转显示顶部导航栏而不显示底部标签
一些代码:
<FlyoutItem Route="animals"
FlyoutDisplayOptions="AsMultipleItems">
<Tab Title="Domestic"
Route="domestic"
Icon="paw.png">
<ShellContent Route="cats"
Style="{StaticResource DomesticShell}"
Title="Cats"
Icon="cat.png"
ContentTemplate="{DataTemplate views:CatsPage}" />
<ShellContent Route="dogs"
Style="{StaticResource DomesticShell}"
Title="Dogs"
Icon="dog.png"
ContentTemplate="{DataTemplate views:DogsPage}" />
</Tab>
<ShellContent Route="monkeys"
Style="{StaticResource MonkeysShell}"
Title="Monkeys"
Icon="monkey.png"
ContentTemplate="{DataTemplate views:MonkeysPage}" />
<ShellContent Route="elephants"
Style="{StaticResource ElephantsShell}"
Title="Elephants"
Icon="elephant.png"
ContentTemplate="{DataTemplate views:ElephantsPage}" />
<ShellContent Route="bears"
Style="{StaticResource BearsShell}"
Title="Bears"
Icon="bear.png"
ContentTemplate="{DataTemplate views:BearsPage}" />
</FlyoutItem>
和
await Shell.Current.GoToAsync($"//animals/monkeys/monkeydetails?name={monkeyName}");
Now I want to ask how to jump to display the top navigation bar
without displaying the bottom tab
最简单的方法是为您的详情页面添加以下代码:
Shell.TabBarIsVisible="False"
整个示例代码为:
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Xaminals.Views.ElephantDetailPage"
Shell.TabBarIsVisible="False"
Title="Elephant Details">
<ScrollView>
<StackLayout Margin="20">
<!--other code-->
</StackLayout>
</ScrollView>
</ContentPage>
在这个例子中, enter image description here 点击商品item跳转到详情页, enter image description here 但我不想在总页上显示底部标签。我用了[shell。当前的。导航。 Pushmodal async],结果是没有实现顶部导航栏。现在想请教如何跳转显示顶部导航栏而不显示底部标签
一些代码:
<FlyoutItem Route="animals"
FlyoutDisplayOptions="AsMultipleItems">
<Tab Title="Domestic"
Route="domestic"
Icon="paw.png">
<ShellContent Route="cats"
Style="{StaticResource DomesticShell}"
Title="Cats"
Icon="cat.png"
ContentTemplate="{DataTemplate views:CatsPage}" />
<ShellContent Route="dogs"
Style="{StaticResource DomesticShell}"
Title="Dogs"
Icon="dog.png"
ContentTemplate="{DataTemplate views:DogsPage}" />
</Tab>
<ShellContent Route="monkeys"
Style="{StaticResource MonkeysShell}"
Title="Monkeys"
Icon="monkey.png"
ContentTemplate="{DataTemplate views:MonkeysPage}" />
<ShellContent Route="elephants"
Style="{StaticResource ElephantsShell}"
Title="Elephants"
Icon="elephant.png"
ContentTemplate="{DataTemplate views:ElephantsPage}" />
<ShellContent Route="bears"
Style="{StaticResource BearsShell}"
Title="Bears"
Icon="bear.png"
ContentTemplate="{DataTemplate views:BearsPage}" />
</FlyoutItem>
和
await Shell.Current.GoToAsync($"//animals/monkeys/monkeydetails?name={monkeyName}");
Now I want to ask how to jump to display the top navigation bar without displaying the bottom tab
最简单的方法是为您的详情页面添加以下代码:
Shell.TabBarIsVisible="False"
整个示例代码为:
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Xaminals.Views.ElephantDetailPage"
Shell.TabBarIsVisible="False"
Title="Elephant Details">
<ScrollView>
<StackLayout Margin="20">
<!--other code-->
</StackLayout>
</ScrollView>
</ContentPage>