如何在Windows Phone 8中使用操纵事件来实现长按? [英] How to implement long press using manipulation events in windows phone 8?
问题描述
由于不推荐使用GestureListener
,所以现在剩下三个事件,分别是ManipulationStarted
,ManipulationDelta
,ManipulationCompleted
.
Since GestureListener
is deprecated, we are now left with three events namely ManipulationStarted
, ManipulationDelta
, ManipulationCompleted
.
我的自定义列表框启用,在列表框项目上左右滑动即可执行某些功能.如何使用操纵事件来检测长按列表框项目?我想以不破坏左右滑动的方式来实现长按.
My custom listbox enables, swiping left and right on listbox items to do certain functions. How do I use the manipulation events to detect long press on a listboxitem? I want to implement the long press in such a way that the swipe left and right is not broken.
任何线索/想法都会有很大帮助!
Any clue/idea would be of great help!
推荐答案
Windows Phone 8包含一个Hold
事件.您可以起诉以检测长按吗?
Windows Phone 8 includes a Hold
event. Can you sue that for detecting the long press?
如果没有,则需要在操纵事件中使用计时器来确定开始操纵与操纵点是否移动(触发增量事件)之间的时间长度,因此建议滑动手势或在您定义的时间内未触发增量事件或完成的事件,那么您可以假设长按.
If not, you'll need to use a timer within your manipulation events to determine the length of time between starting a manipulation and whether the point of manipulation moves (triggering a delta event) and so suggesting a swipe gesture OR if a delta or completed event is not fired within your defined amount of time then you can assume a long press.
这篇关于如何在Windows Phone 8中使用操纵事件来实现长按?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!