Skip to content

Instantly share code, notes, and snippets.

@yuka1984
Created April 22, 2017 05:42
Show Gist options
  • Save yuka1984/ea5f682c07bc86f069609e977181c5b8 to your computer and use it in GitHub Desktop.
Save yuka1984/ea5f682c07bc86f069609e977181c5b8 to your computer and use it in GitHub Desktop.
Xamarin.Forms Android NavigationPage Animation Customize
using XFANavigationSlide.Droid;
using Application = Android.App.Application;
using FragmentTransaction = Android.Support.V4.App.FragmentTransaction;
using View = Android.Views.View;
[assembly: ExportRenderer(typeof(NavigationPage), typeof(MyNavRenderer))]
namespace XFANavigationSlide.Droid
{
public class MyNavRenderer : NavigationPageRenderer
{
protected override void SetupPageTransition(FragmentTransaction transaction, bool isPush)
{
base.SetupPageTransition(transaction, isPush);
if (isPush) transaction.SetCustomAnimations(Resource.Animation.enter_from_right, Resource.Animation.exit_to_left);
else
transaction.SetCustomAnimations(Resource.Animation.enter_from_left, Resource.Animation.exit_to_right);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment