【发布时间】:2019-06-01 15:43:04
【问题描述】:
我正在将现有代码迁移到 Xamarin Forms 4.0 Shell,以前我使用的是 TabbedPage,但现在我想使用 Shell 选项卡。
以下是迁移后代码的样子。我注意到的是它只显示一个顶部选项卡,该选项卡在列表中具有最后一个条目。就我而言,它只显示 Tab2。
<Shell xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:App.Views.Tabs;assembly=App"
x:Class="App.Views.AppShell"
x:Name="self">
<TabBar>
<Tab>
<ShellContent>
<views:Tab1Page BindingContext="{x:Reference self}" Title="Tab1" />
<views:Tab2Page BindingContext="{x:Reference self}" Title="Tab2"/>
</ShellContent>
</Tab>
</TabBar>
</Shell>
【问题讨论】:
-
你想在上面看到两个标签吗?
-
将每个ContentPage放入
<tab>标签 -
@mshwf 将 ContentPage 放在单独的
<tab>中会给我底部标签。相反,我需要顶部的标签。 -
能否分享一个基本的演示,以便我们进行测试?
标签: c# xaml xamarin xamarin.forms xamarin.forms.shell