Android Touch(2)View.OnTouchEvent与View.OnTouchListener区别

 

1,在官方文档 docs/reference/android/view/View.OnTouchListener.html 中对OnTouchListener的描述

  Interface definition for a callback to be invoked when a touch event is dispatched to this view. The callback will be invoked before the touch event is given to the view.

 OnTouchListener是个回调,且先于OnTouchEvent

2,onTouchEvent只能在自定义View时 重写,而OnTouchListener则没有位置限制。

 

 

参看  :  http://stackoverflow.com/questions/19620451/a-views-ontouchlistener-vs-ontouchevent

posted @ 2016-02-04 16:05  f9q  阅读(179)  评论(0编辑  收藏  举报