机器人(X,Y)连续触摸(拖)坐标 [英] Android (x,y) continuous touch (drag) coordinates

查看:194
本文介绍了机器人(X,Y)连续触摸(拖)坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的机器人,我一直在想了一会儿,找出我如何可以检索在屏幕上连续触摸的坐标。例如具有2瓦尔(X,Y)能够实时更新作为手指来回移动。我知道了如何找到它,当触摸而成,但我真的不;弄不明白如何使它后返回结果,当手指移动。

I'm new to android, and I've been trying for a while to find out how can I retrieve the coordinates of a continuous touch on the screen. for example have 2 vars (x,y) that update in real time as finger moves around. I got it how to find it when the touch is made, but I really don;t get it how to make it return the result after that , when the finger is moving.

我一直想switch语句,而/于与ACTION_MOVE不同组合的循环。/ UP / DOWN .. .still什么。

I've been trying switch statements, while/for loops in different combination with ACTION_MOVE./ UP/ DOWN .. .still nothing.

我找到喜欢的网站上同样的问题,但答案只适合第一步(显示仅触摸的协调) 我真的AP preciate解决这个!谢谢!

I've found like the same question on the website, but the answers only fit for the first step(showing the coordination from the touch only) I'd really appreciate a solution to this! Thanks!

推荐答案

没有看到你的code我只是猜测,但本质上,如果你不回的onTouchEvent 第一个电话,你不会看到手势(移动,UP等)的任何后续事件。

Without seeing your code I'm just guessing, but essentially if you don't return true to the first call to onTouchEvent, you won't see any of the subsequent events in the gesture (MOVE, UP, etc).

也许这是你的问题?否则,请把code样品了。

Maybe that is your problem? Otherwise please put code sample up.

这篇关于机器人(X,Y)连续触摸(拖)坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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