How to detect left swipe and right swipe for stacklayout in Xamarin.Forms?

I am trying to detect left swipe and right swipe for stacklayout . Things I need help with

  • Create a stacklayout visualization to add swipe gestures.
  • How to detect a user by tapping left or right.

Please provide a solution that works on cross platforms.

Providing an example for stacklayout renderer will be really useful for using the scroll function in xamarin.forms

+6
source share
2 answers

I made a sample repo on GitHub, let me know what you think? https://github.com/tkowalczyk/SimpleCustomGestureFrame

+4
source

StackLayout , like all other layout classes, does not have a visualization tool, since the layout is fully processed by Xamarin.Forms itself without any help from the built-in layout mechanisms.

What you can do to achieve what you need is to implement your own renderer for Frame and implement your swipe gestures on it. Then you can put your StackLayout in Frame and you have to be settled.

+1
source

Source: https://habr.com/ru/post/978438/


All Articles