對於View來說,事件的返回值是關註的,down時返回true,才能接受up的事件
對於SurfaceView,事件返回值貌似沒有什麼作用
setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
System.out.println("touch");
return true;
}
});
有興趣的朋友可以試試上面的代碼
作者“咖啡伴侶”