Xamarin Forms中的垂直页面动画过渡?

4

是否可能以垂直方向(例如向上滑动)弹出导航页面转换的页面,而不是水平方向?


在我的应用程序中,默认的过渡效果是垂直向上滑动,尽管我没有以任何方式设置它。 - Curiosity
https://github.com/bbl-Laobu/AnimatedTransitionNavPageDemo - Yuri S
1个回答

2
您可以使用可用于Animation Navigation Page的NuGet,在此处
覆盖Xamarin.Forms中调用PushAsync和PopAsync时的默认页面转换。
使用AnimationNavigationPage,您可以在不同页面之间创建自定义转换。 用法:
  1. 为PCL/Net.Standard、IOS和Android项目安装NuGet包。然后添加以下行。
    • Android: 将'FormsControls.Droid.Main.Init()'添加到Xamarin Droid项目的MainActivity.cs中。 enter image description here
    • iOS: 将'FormsControls.Touch.Main.Init()'添加到Xamarin.iOS项目的AppDelegate.cs中。 enter image description here
  2. 声明AnimationNavigationPage: enter image description here
  3. 创建一个动画页面
    • 首先,请确保代码后面继承自AnimationPage: enter image description here
    • 接下来,请使用'controls:AnimationPage'标记而不是'ContentPage'标记,如下所示: enter image description here
    • 最后,我们必须在页面中声明一个标记,以指定我们想要使用哪个转换: enter image description here
请参阅此链接以查看完整文档。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接