如何从内容页面导航到 xamarin.forms 中选项卡式页面的第二个选项卡?

时间:2021-07-14 10:19:10

标签: c# xamarin xamarin.forms xamarin.android frontend

我想从我的内容页面导航到标签页上的第二个标签。请说我该怎么做

 <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>

1 个答案:

答案 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;
相关问题