How to achive IOS like Swipe to delete functionality in xamarin forms

bhargavibhargavi Member ✭✭

Hi Guys,

By Using ListView Context Actions In IOS whenever we swipe we can implement delete functionality there itself but in Android Delete option is coming on Top Navigation Bar When LongPressed.

Now I want to implement in Android also whenever I swipe it should behave like IOS.

Can anyone help on this....

Thanks in Advance

Answers

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    Firstly, we should achieve it by custom renderer listview and create custom items for left swipe .
    To achieve goal we would replace the content of every item into the ListView with three different Box called MainContent, SwipeLeftContent. As you can imagine only the MainContent will be draggable. SwipeLeftContent will be displayed depending on MainContent position.

    You can override the DispatchTouchEvent that could receive the touch event In the listview custom renderer and achieve the transform performance.

    You can refer to this link
    http://cristianoinsola.it/2017/01/29/xamarin-forms-swipelistview/

Sign In or Register to comment.