TouchesCancelled being fired instead of TouchesEnded

Hi all,

I'm learning Xamarin and I have an app that started as an iOS app but I've started to port into a Xamarin Forms app. I've created a custom page renderer for one of the screens and ported the code across. It's mostly worked ok but the touch events seem different.

I have some code that runs in the TouchesEnded event which was fired fine in the iOS only version, but in the Xamarin Forms version that event isn't firing in the same way. Instead, TouchesCancelled gets called.

Normally, for a single quick touch you would see TouchesBegan and then TouchesEnded, but in Xamarin Forms I see TouchesBegan and then TouchesCancelled.

For a long press and some move, I see TouchesBegan, TouchesMoved and then TouchesCancelled on Xamarin Forms. For a longer move I see TouchesBegan, TouchesMoved and then TouchesEnded.

It seems inconsistent from the iOS only version. Is this a bug?

Regards

+Steve

Answers

  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai
    edited April 2017

    This question was also raised by another user in a "Business & Enterprise Support" email thread. After coordinating with that user to create a test case that demonstrated both the correct expected behavior of a native UIViewController and the unexpected different behavior of the Forms PageRenderer, I filed a bug for this issue.

    I will now close this thread to consolidate any further discussion and updates onto that bug report: Bug 37641.


    (As always, I'm also happy to reopen the thread upon request within the next month or two. Just send a quick email to [email protected] with a link to this thread. For follow-up after the next couple of months, if the remaining related open bug reports or forum threads do not cover the desired scenario, please follow the recommendations to create a new bug report, forum thread, or Stack Overflow question. Thanks!)

This discussion has been closed.