How can I add a gesture recognizer to a Label in XAML?

Platform: .NET MAUI| Category: Controls

To add a gesture recognizer to a Label, you can use the GestureRecognizers property.

XAML

<Label Text="Tap Me">
        <Label.GestureRecognizers>
            <TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped"/>
        </Label.GestureRecognizers>
</Label>

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.