使用Xamarin Forms的Android过渡动画 [英] Transition animation for Android using Xamarin Forms
问题描述
是否可以使用Xamarin Forms在Android下实现以下过渡动画?
Is it possible to implement the transition animation below for Android using Xamarin Forms?
这是我在Android上的使用方法.我试图用自定义渲染器实现它,但是当我需要配置Intent时卡住了.另外,我阅读了在单个Intent上运行的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.
推荐答案
我开发了一个插件,可以以xamarin形式(适用于ios和android)进行这种类型的转换.
I have developed a plugin to make this type of transitions in xamarin forms (for ios and android).
关键是使用自定义NavigationPage.在iOS中,您需要实现IUINavigationControllerDelegate和IUIGestureRecognizerDelegate,而在Android中则更容易:只需覆盖SetupPageTransition方法即可.
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.
您可以在此处找到所有源代码: https://github.com/Evolutionlab/Xamarin.Plugin.SharedTransitions
You can find all the source code here: https://github.com/Evolutionlab/Xamarin.Plugin.SharedTransitions
这里是Nuget软件包: https://www.nuget.org/packages/Xamarin.Plugin.SharedTransitions/
Here the Nuget package: https://www.nuget.org/packages/Xamarin.Plugin.SharedTransitions/
P.S.
是的,在Android Xamarin表单上使用单个活动. NavigationPage使用片段在页面之间导航.
Yes, on Android Xamarin forms use a single activity. The NavigationPage use Fragments to navigate between pages.
这篇关于使用Xamarin Forms的Android过渡动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!