Transition animation for Android using Xamarin Forms

大兔子大兔子 提交于 2020-01-17 08:04:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!