Paint p =new Paint();
//清屏
p.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
canvas.drawPaint(p);
p.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC));
//清屏后view显示黑色背景重新定义
canvas.drawColor(Color.WHITE);
Paint p =new Paint();
//清屏
p.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
canvas.drawPaint(p);
p.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC));
//清屏后view显示黑色背景重新定义
canvas.drawColor(Color.WHITE);