Handling gestures with native platform renderers

Built-in gesture recognizers work well for a simple tap and pinch on a view, but sometimes you need more flexibility and control over the touches behavior.

Xamarin.Forms custom renderers will save the day. Creating a custom renderer for a view will provide you with the native functionality that is needed in runtime. There is a custom renderer for every Xamarin.Forms view. To learn more about how to create custom renderers, refer to Using custom renderers to change the look and feel of views recipe from Chapter 2, Declare Once, Visualize Everywhere.

For this section we will create a custom Image class and add custom renderers with native gestures implementation printing messages in the output for testing ...

Get Xamarin: Cross-Platform Mobile Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.