Reputation: 4485
I'm following this Xamarin Forms quick start guide (the one for multiscreen)
BUT I get this error when I try to run the completed program
System.InvalidOperationException: PushAsync is not supported globally on Android, please use a NavigationPage
There is no option to add a 'NavigationPage' to the shared library project.
Any ideas? I'm using Visual Studio 15.5.2 and latest version of everything including Windows 10.
NOTE: in this guide the step 4 no longer matches with Visual studio
There is no longer Cross-Platform > Forms Xaml Page, instead it has been replaced with these options
Upvotes: 2
Views: 3644
Reputation: 889
Their nothing to do with versions, I think you miss some basics of navigations...
You have to have Navigation at first like this in App.cs
MainPage = new NavigationPage(new MyContentPage());
Upvotes: 1
Reputation: 74124
In your Application
subclass (normally in the App.cs
or App.xaml.cs
file if created by template), wrap your first page within a NavigationPage page and now you will be able to push and pop pages.
Sample:
MainPage = new YourFirstPage();
Wrap it in a NavigationPage
MainPage = new NavigationPage(new YourFirstPage());
Upvotes: 4