简体   繁体   中英

Transition animation for Android using Xamarin Forms

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.

在此处输入图片说明

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.

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/

PS

Yes, on Android Xamarin forms use a single activity. The NavigationPage use Fragments to navigate between pages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM