Custom Gestures In Xamarin Forms

Xamarin Forms only comes with a limited set of Gesture Recognizers, most notably the TapGestureRecognizer. Many times you will want more than just that and hence here is how you implement a custom gesture recognizer. In this example I will add the Pressed and Released events to a Xamarin Forms project.

Sample Project is located on Sample-XF-Gestures on GitHub

Create Xamarin Forms Gesture Recognizers

In our common project, we need to create our gesture recognizer for use in Xamarin Forms. I have done 2 examples of a PressedGestureRecognizer and ReleasedGestureRecognizer.

And the ReleasedGestureRecognizer the same again.

Add Custom Renderer

Next we need to a custom renderer for the control we want to add these gestures to. In this example I am using a Label.




These renderers attach the native events to call the Command of the Gesture Recognizer.

Using Gesture Recognizer

Now that we have setup everything, we can now easily add the gesture recognizer to any labels.



  1. Don't miss out on updates
  2. The latest info from this site, Xamarin and the community
  3. Unsubscribe at any time*

* We use MailChimp, with double opt-in, and instant unsubscribe

Microsoft MVP | Xamarin MVP | Xamarin Certified Developer | Xamarin Forms Developer | Melbourne, Australia

Related Posts


  1. Carlos Silva Jr

    Very nice post!
    I am looking for a custom renderer to recognize a 5 seconds press on a image. Looks like your custom gesture can fit my needs.
    But, would you have this code in C# only ?