【发布时间】:2020-10-29 17:29:42
【问题描述】:
我在这样的 ContentPage 中使用 ContentView
<ContentView x:Name="MyContent"
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand">
<ContentView.GestureRecognizers>
<SwipeGestureRecognizer Swiped="SwipLeft" Direction="Left"/>
<SwipeGestureRecognizer Swiped="SwipRight" Direction="Right"/>
</ContentView.GestureRecognizers>
</ContentView>
在后面的代码中,我根据 SwipeDirection 将相关内容设置为 ContentView,如下所示。和 SwipRight 一样。
private void SwipLeft(object sender, SwipedEventArgs e)
{
if (e.Direction == SwipeDirection.Left)
{
//set the relavent page content here
}
}
我需要设置在页面之间滑动时出现的动画或过渡。我只在 iOS 上需要这个。任何人都可以帮助我,或者任何方法都知道任何人可以实现这一目标?
你可以从这张快照中得到灵感 click here for image 所有内容和一切都已完成,我只需要在页面之间添加过渡即可。
【问题讨论】:
-
您是否尝试过使用 CarouselView? docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/…。您无法自定义动画,但它确实有效。
-
您的屏幕截图看起来像标签控件。这是你想要的吗?
-
@xerx 是的。我和那个绑在一起。但这并没有满足我的所有要求。所以我只是摆脱它
-
@Anand 是的。我需要带有顶部选项卡的 iOS 选项卡式页面,这是主页面的子页面。我已经完成了带有自定义功能的标签页。现在我只需要添加一些过渡。
标签: ios xamarin xamarin.forms xamarin.ios swipe-gesture