TapGestureRecognizer not working on a Frame in a grid on iOS or Mac
See original GitHub issueDescription
TapGestureRecognizer not working on a Frame in a grid.
Steps to Reproduce
Try the following code:
var frame = new Frame();
frame.GestureRecognizers.Add(new TapGestureRecognizer() { Command = new Command(() => Debug.WriteLine("dfg")) });
Add the frame to a grid, run iOS or Mac and attempt to tap/click on it. [EDIT], It might be more complex, it needs to be in a scrollview that spans all columns in the grid and in a custom layout control. Will put together an example when I get time. [EDIT 2] Ok, nothing to do with my custom control. A grid, containing scrollview that spans columns, containing a frame that has a tap gesture recogniser added will show the problem.
This is using VSforMac, so the .net version is 6.0.301.
Version with bug
Unknown/Other (please specify)
Last version that worked well
Unknown/Other
Affected platforms
iOS, macOS
Affected platform versions
iOS 15
Did you find any workaround?
Nope
Relevant log output
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:16 (6 by maintainers)
Top Results From Across the Web
Xamarin - Frame.GestureRecognizers doesn't work when ...
I have a Xamarin project with a view of a product's details. I have two buttons which can increase or decrease the quantity...
Read more >TapGestureRecognizer doesn't work at first tap
My project deals with IOS 10.2 and the app user interface has been created using the interface builder through standard components to TapGesture...
Read more >Nested Grid TapGestureRecognizer not working?
I'm new in Xamarin. I have been trying to get tap on every row of my grid but unfortunately not working. I have...
Read more >TapGestureRecognizer in Xamarin Forms for IOS not ...
[regression] [worked-in:16.4.5] I am using Xamarin Forms and currently testing the IOS App. The Command never get executed in ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just tested on iOS with Xamarin.Forms and indeed the touches work. Now the trick is to figure out why it is not working in MAUI…
@mattleibow, re your comment, “As far as I can tell, this is how Xamarin.Forms worked.” We discovered this while migrating our code from Xamarin to MAUI. The Xamarin version of our app uses Frame in this way, and it does work on iOS as well as on Android.
Following up on your earlier comment, “Switching to a Border or a CollectionView seems to make it work again”, I modified the test code from my original post to use CollectionView instead of ListView. When I ran it on an iPhone 7 with iOS 15.6.1 and an emulated iPhone 14 with iOS 16.0, the app crashed on startup. I then restored it to use ListView and the app ran as before – i.e. the Frame ignores clicks, but the app didn’t crash on startup. These tests were done using VS 17.4.2.