如何生成TouchEvent [英] How to Generate TouchEvent
本文介绍了如何生成TouchEvent的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我在SurfaceView上绘制了一组图像(球).现在我正在尝试使我触摸的图像(球)消失.正在将这些图像收集到集合中.我不了解如何在单个图像上生成触摸事件.谁能提供
在这方面有帮助吗?
谢谢
Yashwanth.B
Hi all,
I Have drawn a set of images(balls) on a SurfaceView. Now am trying to make the image(ball) i touch to disappear. Am having those images in a collection. Am not understanding how to generate touch event on individual image. Can any one provide
some help on this?
Thank You
Yashwanth.B
推荐答案
-找出触摸事件的位置(Clickedy [ ^ ])
-检查该位置是否有物体-如果是这样,请识别它.
-杀死它.
能够识别ID上的图形对象将很有帮助-字符串可能很好,UUID也可以解决问题,甚至还可以简单地计算对象(如果缺少1个对象之间的情况,会发生什么情况?)
- figure out the position of the touch event (Clickedy[^])
- check whether there is an object located at that position - if so identify it.
- kill it.
It would be helpful to be able to identify the graphical object on a ID - a String could be fine, an UUID would do the trick too and it might even be able to simply count the objects (what happens when 1 object in between is missing?)
这篇关于如何生成TouchEvent的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文