Hi,
I am using SfListView to display items and to select an item to display a different view, I am using TapGestureRecognizer with NumberOfTapsRequired="2"
When I double tap to select an item, it occasionally doesn't work. Sometimes it requires 3 taps.
Could you please help me with a solution.
SfListView allows selecting items on different gestures such as tap, double tap, and hold by setting the SfListView.SelectionGesture. You can set the selection gesture as DoubleTap to achieve your requirement. |
<syncfusion:SfListView x:Name="listView"
ItemSize="60"
SelectionGesture="DoubleTap"
ItemsSource="{Binding ContactsInfo}">
<syncfusion:SfListView.SelectedItemTemplate>
<DataTemplate>
…
</DataTemplate>
</syncfusion:SfListView.SelectedItemTemplate>
</syncfusion:SfListView> |
Hi Lakshmi,
I have made a sample application and I observed that the tap only works when we click on the item and not anywhere else.
Attaching a video for better understanding.
Thanks
|
<syncfusion:SfListView x:Name="listView"
ItemSize="60"
ItemsSource="{Binding ContactsInfo}">
<syncfusion:SfListView.ItemTemplate>
<DataTemplate>
<StackLayout Orientation="Vertical">
<StackLayout.GestureRecognizers>
<TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped" NumberOfTapsRequired="2"/>
</StackLayout.GestureRecognizers>
<Label Text="{Binding ContactName}" />
</StackLayout>
</DataTemplate>
</syncfusion:SfListView.ItemTemplate>
</syncfusion:SfListView> |
|
<syncfusion:SfListView x:Name="listView"
ItemSize="60"
ItemsSource="{Binding ContactsInfo}">
<syncfusion:SfListView.ItemTemplate>
<DataTemplate>
<StackLayout Orientation="Vertical">
<Label Text="{Binding ContactName}" BackgroundColor="DarkGoldenrod"
HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Label.GestureRecognizers>
<TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped" NumberOfTapsRequired="2"/>
</Label.GestureRecognizers>
</Label>
</StackLayout>
</DataTemplate>
</syncfusion:SfListView.ItemTemplate>
</syncfusion:SfListView> |
Hi Lakshmi,
I have added two TapGestureRecognizers to a label, One gets triggered with single tap and other gets triggered on double tap.
Single tapping is working as expected, when I tap once on label or even outside of it but double tapping only works when I double tap on the label and not outside of it, it requires 3 taps for the event to get triggered when I tap outside of the label.
Could you please help me with a solution.
Thanks
Sonal