获得持续读取继续触摸 [英] get continues reading from continues touch

查看:72
本文介绍了获得持续读取继续触摸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想继续读书,从一个持续降落的事件。 我的意思是我希望得到的事件每0.01秒。 我试着用GestureDetector,我得到了下来,展示和长期活动期间继续 触摸。长事件后,我没有得到任何事件。 请帮助...

I want to get continues reading from a continues touch down event. I mean that I want to get event every 0.01 sec. I've tried to use GestureDetector and I got down, show and long events during a continues touch. After the long event I don't get any events. Please help...

推荐答案

你在哪里记录的事件?当用户触摸屏幕的onTouch()处理函数被调用。你可以对事件的开关情况,以确定哪些用户正在做的:

Where are you logging the events? The onTouch() handler should be called whenever the user touches the screen. You can do a switch case on the event to determine what the user is doing:

switch(event) {
case MotionEvent.ACTION_DOWN:
// When user first touches screen 
break;
case MotionEvent.ACTION_MOVE:
// When user is dragging, or continuous touch
break;
case MotionEvent.ACTION_UP:
// When user stops touching
break;
}

这篇关于获得持续读取继续触摸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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