Hi there!
I am using the TapGestureRecognizer and I have pretty terrible "hit ratio" on the Android Emulator. A lot of times I need to click 4-5 times before it registers an event properly. It seems to work especially bad just when I have started the App.
Is this a known issue or am I doing something wrong? The Buttons I use seem to work much more consistently.
Thank you,
Peter
Below is the XAML of an example (The Command CollectionTapped is what this question is about - I click and it doesn't execute that command consistently)
<RefreshView x:DataType="local:Browse_ViewModel" Command="{Binding LoadCollectionsCommand}" IsRefreshing="{Binding IsBusy, Mode=TwoWay}" BackgroundColor="{StaticResource BackgroundColorPrimary}" Margin="5, 5, 5, 5">
<CollectionView x:Name="CollectionsListView"
ItemsSource="{Binding Collections}"
SelectionMode="None"
BackgroundColor="{StaticResource BackgroundColorTertiary}">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="model:Collection">
<SwipeView Padding="3">
<SwipeView.RightItems>
<SwipeItem Text="Edit" BackgroundColor="Green" Command="{Binding Source={x:Reference page}, Path=BindingContext.EditCollectionCommand}" CommandParameter="{Binding .}"></SwipeItem>
<SwipeItem Text="Delete" BackgroundColor="Red" Command="{Binding Source={x:Reference page}, Path=BindingContext.RemoveCollectionCommand}" CommandParameter="{Binding .}"></SwipeItem>
</SwipeView.RightItems>
<Frame CornerRadius="0" HasShadow="True" Padding="0" BackgroundColor="{StaticResource BackgroundColorSecondary}" HeightRequest="75">
<Grid HeightRequest="75" Padding="0">
<StackLayout Padding="0" Orientation="Horizontal" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Spacing="20" BackgroundColor="Transparent">
<Label Text="{Binding IconString}" TextColor="{StaticResource TextColorPrimary}" FontSize="45" Padding="0" WidthRequest="60" VerticalTextAlignment="Center" Margin="5,0,0,0" HorizontalTextAlignment="Center">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String" Android="FASolid.otf#Font Awesome 5 Free Regular" iOS="Font Awesome 5 Free" />
</Label.FontFamily>
</Label>
<Label Text="{Binding Name}"
LineBreakMode="NoWrap"
Style="{DynamicResource ListItemTextStyle}"
TextColor="{StaticResource TextColorPrimary}"
FontSize="25"
VerticalTextAlignment="Center"/>
<StackLayout.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding Source={RelativeSource AncestorType={x:Type local:Browse_ViewModel}}, Path=CollectionTapped}"
CommandParameter="{Binding .}">
</TapGestureRecognizer>
</StackLayout.GestureRecognizers>
</StackLayout>
</Grid>
</Frame>
</SwipeView>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</RefreshView>