机器人(X,Y)连续触摸(拖)坐标坐标、机器人

由网友(夜清冷、一曲。)分享简介:我是新来的机器人,我一直在想了一会儿,找出我如何可以检索在屏幕上连续触摸的坐标。例如具有2瓦尔(X,Y)能够实时更新作为手指来回移动。我知道了如何找到它,当触摸而成,但我真的不;弄不明白如何使它后返回结果,当手指移动。 I'm new to android, and I've been trying for a wh...

我是新来的机器人,我一直在想了一会儿,找出我如何可以检索在屏幕上连续触摸的坐标。例如具有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.

阅读全文

相关推荐

最新文章