Hello,
Welcome to our Microsoft Q&A platform!
i get this error "PushAsync is not supported globally on Android, please use a NavigationPage."
This is because Navigation.PushAsync
method requires to be used in the navigation stack. To avoid this, try using the model page to perform navigation:
Navigation.PushModalAsync(new NavigationPage(new Page1()));
Or add the tabbedPage to the navigation stack and set the navigationbar invisible. Then it's available to call Navigation.PushAsync
to perform navigation.
public partial class App : Application
{
public App()
{
InitializeComponent();
MainPage = new NavigationPage( new TabbedPage1());
}
}
public partial class TabbedPage1 : TabbedPage
{
public TabbedPage1()
{
InitializeComponent();
NavigationPage.SetHasNavigationBar(this, false);
}
}
public partial class listofinterest : ContentPage
{
private async void Add(object sender, EventArgs e)
{
await Navigation.PushAsync(new NavigationPage(new MainPage()));
}
}
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.