在Xamarin Forms App中拖放标签 [英] Drag and Drop labels in Xamarin Forms App

查看:317
本文介绍了在Xamarin Forms App中拖放标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须开发Xamarin形式的跨平台应用程序,它的要求之一是能够在同一UI的不同视图之间拖放动态生成的标签(即检查图像)。。我已经生成了动态标签,但不确定如何实现拖放功能。有人可以指导我关于此处包含标签的容器的最佳控件选择吗?我还需要编写单独的代码来在Android和IoS上实现拖放吗?如果有人能指出正确的资源,我将不胜感激。我已经用谷歌搜索,但是没有任何有用的教程。像这样的一些教程 ListView DragDropSort 建议为Android和IoS平台编写单独的代码。

I have to develop a cross platform app in Xamarin forms and its one of the requirements is to be able to drag and drop dynamically generated labels between different views on same UI (i.e. check the image).. I have generated the dynamic labels but I am not sure how to implement drag and drop functionality. Can anyone guide me regarding the best choice of controls here like the containers containing the labels? Also do I need to write separate code for implementing the drag and drop on Android and IoS? I will really appreciate if some one can point out the right resource. I have googled but there is not any useful tutorial. Some of the tutorials like this ListView DragDropSort are suggesting writing separate code for Android and IoS platforms.

推荐答案

我会给您一些建议:


  1. 您可以使用 MR.gestures 在xamarin.forms中实现DragAndDrop。

  1. You can use Mr.gestures to achieve DragAndDrop in xamarin.forms.

在此处检查示例: GestureSample ,它可以轻松拖动控件,您可以还可以在此主题中查看讨论。

Check the sample here: GestureSample, it can easily drag controls, you can also check the discussion in this thread.

看看此博客,在Xamarin Forms中使用 Draggable视图

Take a look at this blog, use a Draggable view in Xamarin Forms.

此处的示例: DragViewSample

这是一个Android本机实现exa大量的拖动图像:一次将一个图像拖到另一个图像上

Here is an android native implementation example of dragging images: drag-one-image-at-a-time-to-the-top-of-another-image

在此处采样: DragableView_Demo

这篇关于在Xamarin Forms App中拖放标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆