简体   繁体   English

使用Xamarin Forms的Android过渡动画

[英]Transition animation for Android using Xamarin Forms

Is it possible to implement the transition animation below for Android using Xamarin Forms? 是否可以使用Xamarin Forms在Android下实现以下过渡动画?

What I have is this how to for Android. 我所拥有的是如何在 Android上使用。 I tried to implement it with custom renderers but got stuck when I needed to configure the Intent. 我试图用自定义渲染器实现它,但是当我需要配置Intent时卡住了。 Also, I read Forms apps run on a single Intent. 另外,我阅读了在单个Intent上运行的Forms应用程序。

在此处输入图片说明

The key point is that do the Xamarin.Form have the similar function "MakeSceneTransitionAnimation"? 关键是Xamarin.Form是否具有类似的功能“ MakeSceneTransitionAnimation”?

As my point of view: 我的观点是:

U can use 你可以用

PushAsync(Page page, Animation animation)

to defined your page animation as the gif shows. 定义gif显示的页面动画。

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). 我已经开发了一个插件,可以以xamarin形式(适用于ios和android)进行这种类型的转换。

The key is to use a custom NavigationPage. 关键是使用自定义NavigationPage。 In iOS, you need to implement IUINavigationControllerDelegate and IUIGestureRecognizerDelegate, in Android its easier: just override the SetupPageTransition method. 在iOS中,您需要实现IUINavigationControllerDelegate和IUIGestureRecognizerDelegate,而在Android中则更容易:只需覆盖SetupPageTransition方法即可。

You can find all the source code here: https://github.com/Evolutionlab/Xamarin.Plugin.SharedTransitions 您可以在这里找到所有源代码: https : //github.com/Evolutionlab/Xamarin.Plugin.SharedTransitions

Here the Nuget package: https://www.nuget.org/packages/Xamarin.Plugin.SharedTransitions/ 这里是Nuget包: https ://www.nuget.org/packages/Xamarin.Plugin.SharedTransitions/

PS 聚苯乙烯

Yes, on Android Xamarin forms use a single activity. 是的,在Android Xamarin表单上使用单个活动。 The NavigationPage use Fragments to navigate between pages. NavigationPage使用片段在页面之间导航。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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