xamarin/Xamarin.Forms

[Bug, Android, UWP] Image NumberOfTapsRequired fails on Android when greater than 2

Open

#6,976 opened on Jul 25, 2019

 (3 comments) (4 reactions) (0 assignees)C# (1,926 forks)batch import
a/gestures 🖖e/3 :clock3:help wantedp/Androidp/UWPt/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Description

When adding Image.GestureRecognizers XAML as per the documentation, it will only work when the NumberOfTapsRequired property is set to 1 or 2.

Steps to Reproduce

  1. Create a basic Xamarin Forms Project and in MainPage.xaml, add the following <Image Source="https://upload.wikimedia.org/wikipedia/commons/thumb/f/f2/Xamarin-logo.svg/1280px-Xamarin-logo.svg.png" VerticalOptions="Center" HeightRequest="64"> <Image.GestureRecognizers> <TapGestureRecognizer Tapped="OnTapGestureRecognizerTapped" NumberOfTapsRequired="3" /> </Image.GestureRecognizers> </Image>
  2. Add the following code in MainPage.xaml.cs: void OnTapGestureRecognizerTapped(object sender, EventArgs args) { DisplayAlert("Hello", "Hello World!", "OK"); }
  3. Run Android Project and attempt to tap the app multiple times.

Expected Behavior

The alert is displayed after three taps (this works as expected in iOS)

Actual Behavior

No alert is displayed, even after numerous taps.

Basic Information

  • Version with issue: 4.1.0.555618
  • Last known good version: Unknown
  • IDE: Visual Studio for Mac 8.2 Enterprise
  • Platform Target Frameworks:
    • iOS: 21.14.0.110
    • Android: 9.4.0.51
  • Nuget Packages: None
  • Affected Devices: All Android

Contributor guide