2
votes

I have a problem. I created an app, that uses a wizzard to set some of your settings, so to do that, I created a navigation page. In that navigation page I created my own NavigationBar with a back and next arrow and these functions:

private void arrowBack_Clicked(object sender, EventArgs e)
{
    Navigation.PopAsync();
}

private void arrowNext_Clicked(object sender, EventArgs e)
{
    Navigation.PushAsync(new Devices(), true);
}

But now every page slides in from the bottom, but I want them to slide in from the right and for back I want them to slide in from the left. Now I already found a few projects to create this like this: https://github.com/jsuarezruiz/xamarin-forms-page-transitions, but I was wondering if there isn't something much simpler, because it looks to me like a very wanted feature!

Any suggestions how to make NavigationPage animations from the sides?

1
Maybe you could look at the nuget XForms.Plugin.AnimationNavigationPage,if you don't want to use the third library,you should create custom renderer to define your navigation page on each platform.Leo Zhu - MSFT
Is the page you are navigating from inside a NavigationPage? You can take a look at this docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/… Once you do that, you will be able to get the native animation you desire without using libraries. Share some more code of you current Page, and how your current page is launched, so I can help you betterSaamer

1 Answers

0
votes

The navigation that you are experiencing it is due to the fact that you are using PushModalAsync and PopModalAsync.

Using this your new page will come from the bottom of the screen.

If you change your code to use PushAsync and PopAsync instead (without the word Modal), you will get the navigation that you are looking for.

To get the sliding animation you should set the animation parameter to true, like this:

Navigation.PushAsync(page, true);