我想从我的内容页面导航到标签页上的第二个标签。请说我该怎么做
<TabbedPage.Children>
<local:MoneyExchangeMainScreen Title="home" IconImageSource="cehome" />
<local:ExchangeWallet Title="wallet" IconImageSource="cewallet" />
<NavigationPage Title="prices" IconImageSource="ceprices">
<x:Arguments>
<local:MoneyExchangePrice />
</x:Arguments>
</NavigationPage>
<local:ExchangePage Title="exchange" IconImageSource="ceexchange" />
<local:ExchangePage Title="settings" IconImageSource="cesetting" />
</TabbedPage.Children>
答案 0 :(得分:0)
将 Tabbedpage 设置为 App.MainPage
,并手动设置其 CurrentPage
。
YourTabbed tab = new YourTabbed();
tab.CurrentPage = tab.Children[1]; //this means going to second tab
(App.Current as App).MainPage = tab;