Posts

Showing posts with the label GestureRecognizer

Gesture Recognizers with Xamarin.Forms

Why gestures ?   Some controls does not have support click event. In order to achieve add the below code this will enabling click event in the controls.. Gestures are mainly of 3 types Tap Gesture Recognizer Pinch Gesture Recognizer Pan Gesture Recognizer 1) Tap Gesture Recognizer var tapGestureRecognizer = new TapGestureRecognizer(); tapGestureRecognizer.Tapped += tapGestureRecognizer_Tapped; Controler_Name.GestureRecognizers.Add(tapGestureRecognizer); void tapGestureRecognizer_Tapped(object sender, EventArgs e) { ........//Code here } 2) Pinch Gesture Recognizer var pinchGestureRecognizer = new PinchGestureRecognizer(); pinchGestureRecognizer.PinchUpdated += pinchGestureRecognizer_PinchUpdated; Controler_Name.GestureRecognizers.Add(pinchGestureRecognizer); void pinchGestureRecognizer_PinchUpdated(object sender, PinchGestureUpdatedEventArgs e) { ........//Code here } 3) Pan Gesture Recognizer var panG