Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] [iOS] Tap GestureRecognizers not working in iOS 13.4 #8547

Closed
RobDaytona opened this issue May 2, 2020 · 8 comments
Closed

[Bug] [iOS] Tap GestureRecognizers not working in iOS 13.4 #8547

RobDaytona opened this issue May 2, 2020 · 8 comments
Labels
need-info Waiting for more information before the bug can be investigated
Milestone

Comments

@RobDaytona
Copy link

xamarin/Xamarin.Forms#7922 # Description

The game we are developing, was yesterday for the first time simulated on IOS and also deployed to an iPhone. In both simulations and the actual device, there are areas in the game with the TapGesture Recogniser / Tap Event is broken on IOS. Everything happy in Android as its always been.

All the code is the shared project.

The bug happens in areas where a TapGesture has been added to a BoxView, however this is how we handle all tap events in the game, and there are many areas in the game where this works just fine, which will make tracking down this bug harder....

I am sure that this bug is related to : [Bug] [iOS] GestureRecognizers not working in iOS 13.4 xamarin/Xamarin.Forms#10162

Which apparently has been fixed, however possibly there is somewhere else in your source code that needs to be fixed in a similar manner that was missed? - if possible can you guys take a look again? see if there is any spot you missed?

Our project is huge, and its going to take me a while and a lot of effort to try to create a one page project with steps to reproduce, (something I am working on as we speak), so please be patient on that, I will get you steps to reproduce as soon as I possibly can. I have posted the bug, here so we can get the ball rolling on this one, its a critical critical issue, not being able to handle tap events!

Steps to Reproduce

Working furiously to get you a mini project to look at.

  • IDE: VS Mac 8.5.4 (build 12)
  • iOS 13.4
    (Everything mono, etc.. was setup on the mac yesterday, and paired with the PC (which was also upgraded to the latest everything, pair and simulation on pc worked fine)
    The build and deploy to the iPhone was done on the Mac directly.
@RobDaytona
Copy link
Author

I have attached a sample mini project that displays this Bug behaviour
TapGesture_BoxView_Bug.zip

@RobDaytona
Copy link
Author

This so called bug may have existed in previous versions of Xamarin and iOS however as I only deployed to iOS 2 days ago for the first time I cannot be sure.

However I am glad to report the 'bug' is not Xamarin side, it is in the way my code is written and in how iOS interprets it differently to Android.

Here is the solution:

When adding a box view into a Grid Cell , I was using the BoxView Opacity Property to make the BoxView transparent.
I was using:
BoxView bv = new BoxView();
bv.Opacity = 0; //make the BoxView transparent.

Seems iOS does not like this very much....

It prefers:

bv.Color = Color.Transparent;
bv.Opacity = 0.1; //Any value but 0 will do

Then you can add the tapgesture as per normal :

            TapGestureRecognizer tapGestureRecognizer = new TapGestureRecognizer();
            tapGestureRecognizer.Tapped += clickedOnBoxView;
            bv.GestureRecognizers.Add(tapGestureRecognizer);

In the end a very simple solution. Bug can be closed, but should probably be left for people to search / discover it?

thanks
Rob

@thisismyself
Copy link

We are compiling with two Macs and we have this issue when we compile on the Mac which has XCode 11.4.1. On the Mac with XCode 11.4 it works, I guess cause we are compiling against a pre-iOS-13.4 SDK.

Visual Studio 2019 (for Windows): 16.5.4
MacOS: 10.15.4
XCode: 11.4.1 --> TapGestureRecognizer Issue
XCode: 11.4 --> Everything good
Xamarin.Forms: 4.6.0.726

@samhouts samhouts transferred this issue from xamarin/Xamarin.Forms May 7, 2020
@samhouts
Copy link
Member

samhouts commented May 7, 2020

@thisismyself Can you please attach a small project that demonstrates this issue? Thanks!

@samhouts samhouts added the need-info Waiting for more information before the bug can be investigated label May 7, 2020
@dalexsoto
Copy link
Member

dalexsoto commented May 7, 2020

@thisismyself also make sure that you have the latest stable Xamarin.iOS as of today (>= Xamarin.iOS 13.16.0.13) and that you do not have Xamarin.iOS 13.16.0.11 in any of your two machines.

@chamons chamons added this to the Future milestone May 8, 2020
@thisismyself
Copy link

@samhouts @dalexsoto I cannot reproduce the issue anymore. We guess the installation of Xamarin.iOS 13.16.0.13 package update failed on the failing Mac and we didn't notice this. Thank you for help.

@whitneyschmidt
Copy link
Contributor

Closing as this issue as it is no longer repro.

@thisismyself @RobDaytona thank you for sharing this issue with us, if you begin encountering it again feel free to reopen this issue.

@RobDaytona
Copy link
Author

@thisismyself @whitneyschmidt @samhouts @dalexsoto thank you all for subsequent posts to my work around, glad its been fixed!!!

@xamarin xamarin locked as resolved and limited conversation to collaborators Apr 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need-info Waiting for more information before the bug can be investigated
Projects
None yet
Development

No branches or pull requests

6 participants