xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

[Bug] Layout does not react to tap with CollectionView child on Android #9987

Open vikern22 opened 4 years ago

vikern22 commented 4 years ago

Description

The layout containing a CollectionView does not react to taps in the area where the CollectionView is present on the Android platform. Seems to work fine on the iOS platform.

Steps to Reproduce

  1. Run the attached sample on Android
  2. Tap anywhere on the CollectionView

Expected Behavior

The tapped event is fired and the Label below should display "Tapped!"

Actual Behavior

The tapped event is not fired.

Basic Information

Reproduction Link

https://drive.google.com/open?id=1Ci6NjRY9KvE3RbYSDZQ4f0pV1IsGY_LN

jfversluis commented 4 years ago

Adding the reproduction to the GitHub issue so it won't go lost on us.

If I understand your problem correctly, you have a StackLayout with a TapGestureRecognizer and that recognizer does not fire when you add a CollectionView inside that StackLayout, right?

That is what I see happening. This works for iOS, but not Android. When I change the StackLayout to a Grid it does seem to work.

CollectionViewTest.zip

vikern22 commented 4 years ago

Correct. Does not seem to work if I programatically add a TapGestureRecognizer to the CollectionView either.

vikern22 commented 4 years ago

Does not work replacing the StackLayout with a Grid for me.