xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

[Feedback, UWP] Swipe Gesture Recognizer breaks scrolling on ScrollView #4552

Open samhouts opened 6 years ago

samhouts commented 6 years ago

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>
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

PureWeen commented 5 years ago

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

tekmun commented 5 years ago

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

tekmun commented 5 years ago

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).

PureWeen commented 5 years ago

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

tekmun commented 5 years ago

Hi, is this issue fixed?

tekmun commented 5 years ago

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.

tekmun commented 5 years ago

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

MichaelMeyer1 commented 4 years ago

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