Xamarin.forms: [Feedback, UWP] Swipe Gesture Recognizer breaks scrolling on ScrollView

Created on 27 Nov 2018  路  8Comments  路  Source: xamarin/Xamarin.Forms

Description

When SwipeGestureRecognizers are added to a stacklayout in a scrollview the scrollview will no longer scroll with touch.

The only way to see this behavior is to use the simulator or a device where you can actually touch the screen.

<ScrollView BackgroundColor="Yellow">
    <StackLayout Orientation="Vertical" BackgroundColor="Purple">
        <StackLayout.GestureRecognizers>
            <SwipeGestureRecognizer Direction="Left" Swiped="OnTestLayoutLeftSwiped" />
            <SwipeGestureRecognizer Direction="Right" Swiped="OnTestLayoutRightSwiped" />
        </StackLayout.GestureRecognizers>

        <Label Text="Swipe me" x:Name="lblSwiped" WidthRequest="200" HeightRequest="300" BackgroundColor="Green"></Label>
        <Label Text="Swipe 1" WidthRequest="200" HeightRequest="300" BackgroundColor="Blue"></Label>
        <Label Text="Swipe 2" WidthRequest="200" HeightRequest="300" BackgroundColor="Aqua"></Label>
        <Label Text="Swipe 3" WidthRequest="200" HeightRequest="300" BackgroundColor="Yellow"></Label>
    </StackLayout>
</ScrollView>

```C#
private void OnTestLayoutLeftSwiped(object sender, SwipedEventArgs e)
{
lblSwiped.Text = "Swiped Left";
}

private void OnTestLayoutRightSwiped(object sender, SwipedEventArgs e)
{
lblSwiped.Text = "Swiped Right";
}
```

View on Developer Community

To find diagnostic information, see the original linked feedback ticket.

Source

736026

5 feedback-ticket help wanted inactive UWP bug up-for-grabs

Most helpful comment

Hi, is this issue fixed?

All 8 comments

I'm not seeing the issue described in the ticket.
I've attached a reproduction here that works for me on UWP/Android/iOS

SwipeGestureRecognizerUWP.zip

On Xamarin.UWP, top bottom swipe is not scrolling. I have added more labels so that the vertical scroll is shown. But I cannot scroll by swiping up and down.
SwipeGestureRecognizerUWP-Updated.zip

On Android, if custom renderer is used for label and either one of these are enabled [ SetTextIsSelectable(true), Click += ClickLabel, MovementMethod = new LinkMovementMethod() ], the swipe will not work. Also, the swipe is not sensitive with custom renderer.

On iOS, everything is working fine (even with custom renderer).

alright @tekmun I updated the description on the ticket to reflect the problem. Please let me know if that represents the issue you are seeing

Hi, is this issue fixed?

Hi, did anyone try out the attached sample code that shows Xamarin.UWP is unable to scroll up and down once the swipe gesture recognizer is attached to the scrollview. To me, the bug is obvious. Any updates? Thanks.

Hi, this issue is not fixed yet. Is there anything I can do to expedite a solution? Thanks.

@samhouts is this being looked at still? I'm having this issue with VS 2019 and my android simulator.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

suihanhbr picture suihanhbr  路  3Comments

rmarinho picture rmarinho  路  3Comments

joseluisct picture joseluisct  路  3Comments

EmilAlipiev picture EmilAlipiev  路  3Comments

jgold6 picture jgold6  路  3Comments