Skip to content

How to handle Tap with Label and Spans? #20

@akamud

Description

@akamud

Apparently the treatment is a little different, this might be useful:

            // if (view == null)


            var captured = false;

            var children = view.GetChildElements(Point.Zero);

            if (children != null)
                foreach (var recognizer in children.GetChildGesturesFor<TapGestureRecognizer>(recognizer =>
                    recognizer.NumberOfTapsRequired == numberOfTapsRequired))
                {
                    recognizer.SendTapped(view);
                    captured = true;
                }

            if (captured)
                return;

            foreach (var gestureRecognizer in view.GestureRecognizers.GetGesturesFor<TapGestureRecognizer>(x =>
                x.NumberOfTapsRequired == numberOfTapsRequired))
            {
                gestureRecognizer.SendTapped(view);
            }

https://github.com/xamarin/Xamarin.Forms/blob/80a4dbfb1cd897f478c38d0aafa6a5d67940d2f3/Xamarin.Forms.Core/EnumerableExtensions.cs

https://github.com/xamarin/Xamarin.Forms/blob/80a4dbfb1cd897f478c38d0aafa6a5d67940d2f3/Xamarin.Forms.Core/Label.cs#L386

https://github.com/xamarin/Xamarin.Forms/blob/80a4dbfb1cd897f478c38d0aafa6a5d67940d2f3/Xamarin.Forms.Platform.Android/TapGestureHandler.cs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions