I am trying to use the drag gesture in my code. But unfortunately it's not working.The following is the code snippet I am using. Is there any problem with it? If so help me.
TouchPanel.EnabledGestures = GestureType.DragComplete | GestureType.Tap | GestureType.Pinch | GestureType.FreeDrag;
while (TouchPanel.IsGestureAvailable)
{
GestureSample gesture = TouchPanel.ReadGesture();
if (gesture.GestureType == GestureType.DragComplete)
{
// do something
}
}
TouchPanel.EnabledGestures = GestureType.Tap | GestureType.DragComplete;
foreach (GestureSample gestureSample in input.Gestures)
{
if (gestureSample.GestureType == GestureType.Tap)
{
Debug.WriteLine("tapped ");
}
else if (gestureSample.GestureType == GestureType.DragComplete)
{
Debug.WriteLine("dragged");
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.