当前位置:编程学习 > wap >>

ontouch,ontouchlistener,ontouchevent三者是什么关系。

ontouchlistener是借口,ontouch是他必须实现的方法,但这个方法是干什么的啊?

ontouchevent是用来处理键位和触屏的,ontouch是干什么?

另外ongesturelistener和ontouchlistener是什么关系?

--------------------编程问答-------------------- ontouchListener接口是用来处理手机屏幕事件的监听接口,当为View的范围内触摸按下、抬起或滑动等动作时都会触发该事件
事件方法里面是动作(就是触摸按下之后的动作)

OnGestureListener实现滑屏事件 --------------------编程问答-------------------- 实现触屏使用ontouchevent函数,哪个ontouch是干什么的? --------------------编程问答-------------------- ontouch方法里面是触屏后的动作。。 --------------------编程问答--------------------
引用 3 楼 a28737077 的回复:
ontouch方法里面是触屏后的动作。。

在这里我也可以做什么?我写了一个log函数,他都不往外输出东西。。。。。

也可以根据motionevent,来判断down,up,mov,cancel吗?

如果这样,要ontouchevent干什么? --------------------编程问答-------------------- 自己顶上去。。。这一块弄不清楚,学习android是很痛苦的。 --------------------编程问答-------------------- 还有,用Activity实现OnGestureListener和实现android.view.GestureDetector.OnGestureListener,不一样啊啊。

默认的必须实现的函数都不一样,前者是ongesture,ongesturecancelled,ongestureended,ongesturestarted.

后者实现的是ondown,onfilling,onlongpress,onscroll,onshowpress,onsingletapup. --------------------编程问答-------------------- 分不清楚他们之间的区别,一样求问中............. --------------------编程问答-------------------- 不懂。 --------------------编程问答-------------------- onTouchListener是接口,onTouch是其必须实现的方法,它用来处理触摸(按下、滑动和弹起)事件的。
onTouchEvent是另一种处理触摸事件的方法,它是View中的方法,该方法要放在View类中。 --------------------编程问答-------------------- 我也不明白
补充:移动开发 ,  Android
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,