我只是想用canvas.drawPoint绘制一个点,我的手指放在画布里面。一切正常但问题是,当我的手指从我的真实手指位置移向屏幕的按钮时,从MotionEvent检索的位置越来越偏移(视图覆盖了所有屏幕)。谁能猜出发生了什么?
public boolean onTouch(View v, MotionEvent event)
{
int action = event.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
break;
case MotionEvent.ACTION_MOVE:
upx = event.getX();
upy = event.getY();
canvas.drawPoint(upx,upy,paint);
choosenImageView.invalidate();
break;
case MotionEvent.ACTION_UP:
upx = event.getX();
upy = event.getY();
canvas.drawPoint(upx,upy,paint);
choosenImageView.invalidate();
break;
case MotionEvent.ACTION_CANCEL:
break;
default:
break;
}
return true;
}
提前致谢。