TapGestureRecognizer not working with Spans on iOS

Anonymous
2020-12-02T12:54:10.48+00:00

Tap gesture not working on iOS devices
below is the code.

<Label Grid.Column="1" Padding="10" x:Name="lblPrivacyLink">
<Label.FormattedText>
<FormattedString>
<Span Text="{x:Static resource:AppResource.LOGIN_CHECKBOX_TERMS_PRIVACY_MESSAGE_1}" FontFamily="{StaticResource BasicFont}" FontSize="14" TextColor="{StaticResource LabelColor}"/>
<Span Text="{x:Static resource:AppResource.LOGIN_CHECKBOX_TERMS_PRIVACY_MESSAGE_2}" FontFamily="{StaticResource ContentFontBold}" FontSize="16" TextColor="{StaticResource LabelPlaceHolder}">
<Span.GestureRecognizers>
<TapGestureRecognizer Tapped="TermsTapGestureRecognizer_Tapped" NumberOfTapsRequired="1"/>
</Span.GestureRecognizers>
</Span>
<Span Text="{x:Static resource:AppResource.LOGIN_CHECKBOX_TERMS_PRIVACY_MESSAGE_3}" FontFamily="{StaticResource BasicFont}" FontSize="14" TextColor="{StaticResource LabelColor}"/>
<Span Text="{x:Static resource:AppResource.LOGIN_CHECKBOX_TERMS_PRIVACY_MESSAGE_4}" FontFamily="{StaticResource ContentFontBold}" FontSize="16" TextColor="{StaticResource LabelPlaceHolder}">
<Span.GestureRecognizers>
<TapGestureRecognizer Tapped="PrivacyTapGestureRecognizer_Tapped" NumberOfTapsRequired="1"/>
</Span.GestureRecognizers>
</Span>
</FormattedString>
</Label.FormattedText>
</Label>

when click TermsTapGestureRecognizer_Tapped then call PrivacyTapGestureRecognizer_Tapped tapped gesture and when click PrivacyTapGestureRecognizer_Tapped then call PrivacyTapGestureRecognizer_Tapped gesture

always call one event when click anyone of both of this.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,292 questions
{count} votes