Search code examples
c#xamarinxamarin.formsslideuitapgesturerecognizer

Launch event on finger slide over the View in Xamarin


Is anything of such possible to achieve in Xamarin for Android and iOS?

I was using tap events on the views so far, but I am not sure how to induce event when I actually tap anywhere, and then slide finger over the taprecogniser or other gesture recogniser.


Solution

  • use a Swipe gesture

    var leftSwipeGesture = new SwipeGestureRecognizer { Direction = SwipeDirection.Left };
    leftSwipeGesture.Swiped += OnSwiped;
    
    myView.GestureRecognizers.Add(leftSwipeGesture);