问题
Is it possible to implement the transition animation below for Android using Xamarin Forms?
What I have is this how to for Android. I tried to implement it with custom renderers but got stuck when I needed to configure the Intent. Also, I read Forms apps run on a single Intent.
回答1:
I have developed a plugin to make this type of transitions in xamarin forms (for ios and android).
The key is to use a custom NavigationPage. In iOS, you need to implement IUINavigationControllerDelegate and IUIGestureRecognizerDelegate, in Android its easier: just override the SetupPageTransition method.
You can find all the source code here: https://github.com/Evolutionlab/Xamarin.Plugin.SharedTransitions
Here the Nuget package: https://www.nuget.org/packages/Xamarin.Plugin.SharedTransitions/
P.S.
Yes, on Android Xamarin forms use a single activity. The NavigationPage use Fragments to navigate between pages.
回答2:
The key point is that do the Xamarin.Form have the similar function "MakeSceneTransitionAnimation"?
As my point of view:
U can use
PushAsync(Page page, Animation animation)
to defined your page animation as the gif shows.
When the new page init u should use the
MyImageControl.TranslateTo(-100,-100, 1000);
To defined the control animation.
来源:https://stackoverflow.com/questions/40622967/transition-animation-for-android-using-xamarin-forms