当手指在电话屏幕上移动时,我正在使用 sufaceview 绘制路径。但是当我快速移动手指时,所有点都没有注册,我面临着闪烁
@Override
public void run() {
while(running){
running = true;
if(!holder.getSurface().isValid())
continue;
Canvas canvas = holder.lockCanvas();
canvas.drawCircle(right, bottom, 2, paint);
holder.unlockCanvasAndPost(canvas);
}
}
@Override
public boolean onTouch(View view, MotionEvent event){
switch(event.getAction()){
case MotionEvent.ACTION_MOVE:
right = event.getX();
bottom = event.getY();
break;
}
return true;
}
有人可以帮忙吗?
在此先感谢,贾根