Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Gesture not updating its status as completed

$
0
0

I have a PanGestureRecognizer in my custom view. For the PanUpdated event handler, I have a function that does some stuff when the gesture is running and then something else when the gesture is completed. However, sometimes the gesture never gets to its completed state.
Any ideas?

Here's what I have...

        class ImageContainer : ContentView
        {

            public ImageContainer()
            {
                PanGestureRecognizer panGesture = new PanGestureRecognizer();
                panGesture.PanUpdated += OnPanUpdated;
                GestureRecognizers.Add(panGesture);
            }


            void OnPanUpdated(object sender, PanUpdatedEventArgs e)
            {
                switch(e.StatusType)
                {
                            case GestureStatus.Started:
                                // do some stuff
                                break;  
                    case GestureStatus.Running:
                    // do more stuff
                                break;
                            case GestureStatus.Completed:
                                // sometimes this does not get called!
                                break;
                }
            }
        }

Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>