Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

How to ignore the tapped of an overlapping element

JoyPeterJoyPeter Member ✭✭

I have two components one red and one pink, the pink is superimposing the red component.
the red component has a TapGestureRecognizer. I would like to know if it is possible to ignore the Tapped of the pink component,
in other words, when tapping the pink component, tap the red component. I don't know if I was clear



  • JarvanJarvan Member, Xamarin Team Xamurai
    edited April 1

    Is the red component a subview of pink component? If so, the pink component's tag gesture event will not be trigger when clicking the red component. Because the subview's priority is higer.

    <StackLayou BackgroundColor="Pink">
            <TapGestureRecognizer Tapped="PinkTapGestureRecognizer_Tapped"/>
        <StackLayout HeightRequest="200" BackgroundColor="Red">
                <TapGestureRecognizer Tapped="RedTapGestureRecognizer_Tapped"/>

Sign In or Register to comment.