I am currently building my mobile application using Xamarin.Forms and i encountered a problem (on both platform of ios and android) when i tried to use Xamarin.Forms gestures more particularly a tap gesture on a xaml Label. Because i want to use this label as a link.
The problem is that this tab gesture that i used does not work sometime ( approximately 5 times test = 1 time bug).
During DEBUG when the problem occured i see that the tabbing is still recognized but it did not respond in the action i set up.
It occurs on both iOS and Android devices.
Here is my XAML code:
<RelativeLayout> <Image Source="icon_question" WidthRequest="15" HeightRequest="15"></Image> <Label Margin="15, -3, 0, 0" HorizontalOptions="CenterAndExpand" HorizontalTextAlignment="Center" Text="Some text" TextColor="Blue" FontSize="15" TextDecorations="Underline"> <Label.GestureRecognizers> <TapGestureRecognizer Tapped="_tabLinkForgetPassword"></TapGestureRecognizer> </Label.GestureRecognizers> </Label> </RelativeLayout>
and here is my code behind:
private void _tabLinkForgetPassword(object s, EventArgs e) { App.Current.MainPage = new ResetPasswordPage(false); }