TapGestureRecognizer Not working on iOS

Andrew 16 Reputation points
2020-12-02T04:26:16.427+00:00

I'm working on an application where I've used TapGestureRecognizer on a Path. This works correctly in Android but when I build and debug on an iOS device (physical or emulated) the command bound to the recognizer doesn't work. The code is as follows:

<shapes:Path Data="{StaticResource CustomIconResource}">
    <shapes:Path.GestureRecognizers>
        <TapGestureRecognizer Command="{Binding ExecuteMyCommand}" />
    </shapes:Path.GestureRecognizers>
</shapes:Path>

I don't see any exceptions in the log that would indicate why this isn't working. Any help on this would be great.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,293 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Andrew 16 Reputation points
    2020-12-07T16:23:22.007+00:00

    Until the issue with `` on iOS is fixed I created a custom control to wrap a Shape in a ContentView and set the TapGestureRecognizer on the ContentView instead. The code has been attached.

    45764-iconbuttonxaml.txt
    45853-iconbuttonxamlcs.txt

    0 comments No comments