Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Make PanGestureRecognizer and ScrollView working together on Android

Hello everyone !

It seems that PanGestureRecognizer and ScrollView are not working together on Android.

I use them in a listview.

With PanGesture I need to detect the gesturetap and scrollview to scroll my content.

Is there a way to do this with a custom renderer for Android ?

Thanks !

Answers

  • Seb_GlanumSeb_Glanum Member ✭✭

    It's my last thread but in my case I need to have PanGesture to detect the GestureStatus.

  • ColeXColeX Member, Xamarin Team Xamurai

    PanGestureRecognizer does the same stuff as ScrollView , why you want them both together?

    To detect the movement , you could get ScrollX and ScrollY in Scrolled event of ScrollView .

  • Seb_GlanumSeb_Glanum Member ✭✭

    In my case I have 2 stacklayouts in a ScrollView with orientation horizontal and width equals to device width, if you scroll to left you can see the second stack.

    If ScrollX scroll to the middle of my viewcell and I have GestureType.Completed you will see completely the second stack.

    If I do this with only just ScrollX and when scroll is in the middle it will automatically scroll to my new position and don't want it like that.

    Once PanGesture has detect GestureType.Completed and at this moment I want to execute ScrollTo().

    What you suggest is a strange behaviour.

    Look at the Outlook app on mobile when you swipe an email.

  • ColeXColeX Member, Xamarin Team Xamurai

    You don't have to handle pan gesture and scrollView , it's too complicated.

    CarouselView can do this easily ,check my project below.

  • Seb_GlanumSeb_Glanum Member ✭✭

    Can I use it inside of a listview with a pull to refresh ?

Sign In or Register to comment.