surfaceview translucent

android.opengl.GLSurfaceView
surfaceView.setZOrderOnTop(true);
surfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
surfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);

Surfaceview
surfaceView.setZOrderOnTop(true);
surfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);

paint.setAntiAlias(true);
paint.setStyle(Paint.Style.STROKE);
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
canvas.drawPaint(paint);

你可能感兴趣的:(SurfaceView)