xamarin/Xamarin.Forms

Swiped Event of SwipeGestureRecognizer does not contain actual direction

オープン

#4,473 opened on 2018/11/19

 (9 件のコメント) (0 件のリアクション) (0 人の担当者)C# (1,926 件のフォーク)batch import
a/gestures 🖖e/3 :clock3:help wantedinactiveproposal-opent/bug :bug:t/enhancement ➕up-for-grabs

Repository metrics

Stars
 (5,644 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

Description

The Swiped event of SwipeGestureRecognizer does not contain actual direction

Steps to Reproduce

Create a new page and in Xaml:

<!-- Swipe Gesture -->
<Label Text="Swipe Gesture" class="featureHeader" Margin="0,20,0,10"/>
<BoxView BackgroundColor="Black" Margin="0,0,0,10" HeightRequest="1"/>
<Label Text="Swipe right-to-left or left-to-right on the green box below." Margin="0,10"/>
<BoxView BackgroundColor="Lime" WidthRequest="300" HeightRequest="300">
    <BoxView.GestureRecognizers>
        <SwipeGestureRecognizer
            Direction="Right, Left"
            Swiped="SwipeGestureRecognizer_Swiped" />
    </BoxView.GestureRecognizers>
</BoxView>

In code:

private async void SwipeGestureRecognizer_Swiped(object sender, SwipedEventArgs e)
{
    await DisplayAlert("Swiper No Swiping!", $"Yay! You swiped to the {e.Direction}!", "Close");
}

Run the app and swipe either way,

code sample taken from TheLittleThingsPlayground

Actual Behavior

image

Expected Behavior

The message should tell the actual direction of the swipe, either Right or Left, I didn't swipe in both directions at the same time

Basic Information

Testing on:

  • Xamarin.Forms: 3.4
  • IDE: 15.9
    • iOS: 12.1

コントリビューターガイド