Xamarin.Forms拖动listview项目并显示选项?

问题描述 投票:0回答:1

Hy伙计们,我正在使用Xamarin.Forms,我有一个疑问,我可以在ListView中做这样的事吗?

Delete Item from list View on left drag

listview button xamarin.forms drag
1个回答
0
投票

有可能实现这一点。您必须创建自定义渲染器才能执行您想要的操作。对于iOS,自定义渲染器将在此帖子中完成:http://forums.xamarin.com/discussion/comment/56693/#Comment_56693

对于Android,它会有点棘手,因为刷卡列表视图不是原生的,但也许您可以自己实现OnFling方法,也可以在自定义渲染器中使用像这样的项目:https://github.com/47deg/android-swipelistview

此外,这里有一篇文章,提供了使用手势识别器制作自定义渲染器的一些见解:http://arteksoftware.com/gesture-recognizers-with-xamarin-forms/

您也可以使用SfListView来实现这一目标。 https://help.syncfusion.com/xamarin/sflistview/swiping#swipe-customizations

有运行演示的GIF。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.