从表面按钮拖放 [英] Drag Drop From Surface Button

查看:76
本文介绍了从表面按钮拖放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我只是想知道是否有一种干净的方法来实现拖拽表面按钮。场景如下:


在应用程序的中心放置一个菜单。它有4个按钮。单击按钮时,会创建一个scatterviewitem并将其抛出到scatterView(在整个窗口上拉伸)。我现在想要向用户提供这样的能力,而不是仅仅
点击并随机抛出一个scatterviewitem,他们可以触摸表面按钮并将其拖动到散点图上,然后我将在其中创建scatterviewitem位置。


有关如何完成此任务的任何建议或示例?



提前致谢

解决方案

我建议您为此创建自己的自定义控件,而不是使用SurfaceButton。然后,您可以收听TouchDown,TouchMove和TouchUp,以消除"点击"和"点击"之间的歧义。和"在您的自定义控件上滑动"。此外,我建议创建
某种视觉反馈,以便用户了解即将发生的事情。


祝你好运!


-Luis。


Hi All, Im just wondering whether there is a clean way to implement drag and drop on a surface button. Scenario is as follows:

Have a menu in the center of the application. It has 4 buttons. When a button is clicked a scatterviewitem is created and thrown onto the scatterView (which stretches over the entire window). I now want to give the ability to the user so instead of just clicking and randomly throwing out a scatterviewitem, they can touchdown on the surface button and drag it to whereever on the scatterview and than I will create the scatterviewitem in that location.

Any advice or examples on how to accomplish this?

Thanks in advance

解决方案

I would recommend just creating your own custom control for this instead of using SurfaceButton. Then you can listen for TouchDown, TouchMove and TouchUp to disambiguate between a "click" and a "slide on your custom control". Also, I would recommend creating some kind of visual feedback so the user can understand what is about to happen.

Best of luck!

-Luis.


这篇关于从表面按钮拖放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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