0
这是我的代码。我很困惑onTouch(),请看看
当返回false时,只能调用ACTION_DOWN,并且返回true时,所有操作都可以,为什么?
aView = findViewById(R.id.a1);
aView.setOnTouchListener(new OnTouchListener(){
//@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
System.out.println("Gallery onTouch");
if(event.getAction()==MotionEvent.ACTION_MOVE){
Log.e("touchtest", "ACTION_MOVE");
System.out.println("ACTION_MOVE ");
}else if(event.getAction()==MotionEvent.ACTION_UP){
Log.e("touchtest", "ACTION_UP");
System.out.println("ACTION_UP ");
}else if (event.getAction()==MotionEvent.ACTION_DOWN){
Log.e("touchtest", "ACTION_DOWN");
}
return true;
}
});
返回true,这没关系,现在...为什么会出现必须返回true – Nick 2010-11-09 06:20:12
我现在明白了...谢谢 – Nick 2010-11-09 06:22:07