Gestures, maps, and WebViews
Gestures, maps, and WebViews are very commonly used user-interface facilities. While they are all in Xamarin Forms, we will see that they are not as extensive as if they were native versions.
Gestures
All mobile devices have some form of a sweep system. The iOS is especially rich when it comes to having a multi-touch user interface. As with everything to do with Xamarin.Forms
, it only covers the basic type of touch, essentially the only one supported on all platforms.
Note
Code for the following is given in Chapter2/Gestures
.
Gestures are not enabled on all types of gadgets (for example, gestures are not enabled for dragging pins on a map). This is because only tap detection is currently supported.
Adding a gesture recognizer
In this example, we'll add a gesture recognizer to a label. Labels usually don't have a click event.
Let's create the label:
var count = 0; var label = new Label() { Text = string.Format("You have clicked me {0} times", count), TextColor = Color...