我正在像这样的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 所有内容和一切都完成了,我只需要在页面之间添加过渡即可。