Skip to content

SFListView Swiping is not working in Android #46

@Divyesh-Bhatt

Description

@Divyesh-Bhatt

I've used SFListView control for showing vertical list of data. In that I have to provide Delete feature on Swipe.
So I have implemented EndSwipeTemplate.

iOS
It is working fine.

Android
Not working at all.

Sample Code

<syncfusion:SfListView
    x:Name="listView"
    AllowSwiping="True"
    ItemsSource="{Binding Contacts}"
    SwipeThreshold="100"
    SwipeOffset="150"
    SelectionMode="Multiple"
    SelectionGesture="LongPress"
    ScrollBarVisibility="Always"
    AutoFitMode="Height">
    <syncfusion:SfListView.ItemTemplate x:DataType="model:Contact">
        <DataTemplate x:Name="EndSwipeTemplate" >
            <VerticalStackLayout >
                <local:ContactCard BindingContext="{Binding Path=.}">
                    <local:ContactCard.GestureRecognizers>
                        <TapGestureRecognizer
                                Command="{Binding Path=BindingContext.CardSelectedCommand,
                                                  Source={Reference Name=_contactCardListPage}}" />
                    </local:ContactCard.GestureRecognizers>
                </local:ContactCard>
            </VerticalStackLayout>
        </DataTemplate>
    </syncfusion:SfListView.ItemTemplate>
    <syncfusion:SfListView.EndSwipeTemplate>
        <DataTemplate>
            <Grid BackgroundColor="#DD0000"
                    x:Name="listViewGrid">
                <Grid.GestureRecognizers>
                    <TapGestureRecognizer
                        Command="{Binding Path=BindingContext.DeleteCommand,
                                            Source={x:Reference listView}}"
                        CommandParameter="{Binding .}" />
                </Grid.GestureRecognizers>
                <Label Text="Delete"
                        TextColor="#FFFFFF"
                        HorizontalOptions="Center"
                        FontSize="Small"
                        VerticalOptions="Center">
                </Label>
            </Grid>
        </DataTemplate>
    </syncfusion:SfListView.EndSwipeTemplate>

</syncfusion:SfListView>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions