【发布时间】:2021-07-02 06:19:22
【问题描述】:
您好,我遇到了这个问题,我需要回到我的第一个 Shell 项目,因为我不知道怎么做,而且谷歌搜索没有帮助我在这里问。
<ShellItem Route="ChoicePage" >
<ShellContent ContentTemplate="{DataTemplate local:ChoicePage}" />
</ShellItem>
<ShellItem Route="LoginPage" >
<ShellContent ContentTemplate="{DataTemplate local:LoginPage}" />
</ShellItem>
<TabBar Route="MainPage">
<Tab Title="{helpers:Translate Explore}"
Icon="explore.png"
Route="ExplorePage">
<ShellContent ContentTemplate="{DataTemplate local:ExplorePage}" />
</Tab>
<Tab Title="{helpers:Translate Plan}"
Icon="globe.png"
Route="NextTripsPage">
<ShellContent ContentTemplate="{DataTemplate local:NextTripsPage}" />
</Tab>
<Tab Title="{helpers:Translate Trips}"
Icon="around.png"
Route="MyTripsPage">
<ShellContent ContentTemplate="{DataTemplate local:MyTripsPage}" />
</Tab>
<Tab
Title="{helpers:Translate Map}"
Icon="map.png"
Route="MyMap">
<ShellContent ContentTemplate="{DataTemplate local:FullMapPage }" />
</Tab>
<Tab
Title="{helpers:Translate MeTextProfile}"
Icon="me.png"
Route="MyProfilePage">
<ShellContent ContentTemplate="{DataTemplate local:MyProfilePage}" />
</Tab>
</TabBar>
我有这 2 个 shell 项目,当用户转到 ExplorePage 或任何 TabBar 时,我想将后退按钮设置为返回 ChoicePage。我尝试添加await Shell.Current.GoToAsync("..");,但没有运气,即使PopToRootAsync() 也不起作用。
【问题讨论】:
标签: c# xaml xamarin.forms xamarin.forms.shell