Drag and Drop labels in Xamarin Forms App

北慕城南 提交于 2020-05-24 04:02:26

问题


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:


I would give you several suggestions:

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

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

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

    Sample here: DragViewSample

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

    Sample here :DragableView_Demo



来源:https://stackoverflow.com/questions/57187414/drag-and-drop-labels-in-xamarin-forms-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!