對(duì)于View來(lái)說(shuō),事件的返回值是關(guān)注的,down時(shí)返回true,才能接受up的事件
對(duì)于SurfaceView,事件返回值貌似沒(méi)有什么作用
有興趣的朋友可以試試上面的代碼
setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
System.out.println("touch");
return true;
}
});
public boolean onTouch(View v, MotionEvent event) {
System.out.println("touch");
return true;
}
});
有興趣的朋友可以試試上面的代碼