如何在Blackberry中创建一个手势活动,使图像在不同的屏幕上一个接一个出现?有人可以用一个例子来解释我吗?我希望从左侧和右侧拖动鼠标时,图像会一个接一个地出现
答案 0 :(得分:2)
BlackBerry网站上有一些示例代码。
创建可滚动图像字段
http://supportforums.blackberry.com/t5/Java-Development/Create-a-scrollable-image-field/ta-p/444955
听起来你可能会发现触摸手势有用的介绍
http://supportforums.blackberry.com/t5/Java-Development/Introduction-to-Touch-Gestures/ta-p/555363
答案 1 :(得分:2)
使用以下代码查找touchGESTURE。
protected boolean touchEvent(TouchEvent message)
{
switch(message.getEvent())
{
case TouchEvent.GESTURE:
TouchGesture gesture = message.getGesture();
switch(gesture.getEvent())
{
case TouchGesture.NAVIGATION_SWIPE:
Dialog.alert("Swipe direction: " + gesture.getSwipeDirection()
+ ", "
+ "\nMagnitude: " + gesture.getSwipeMagnitude());
return true;
}
}
return false;
}
了解更多信息,请访问Swipe_gestures_trackpad