how to make surfaceview transparent

后端 未结 4 1625
[愿得一人]
[愿得一人] 2020-11-22 17:05

Hello all i want to make my DrawingSurface view transparent. i tried many thing but it\'s not working.

Here is my xml code to make my surface view transparent

<
4条回答
  •  没有蜡笔的小新
    2020-11-22 17:54

    Try this in the constructor:

    SurfaceView sfvTrack = (SurfaceView)findViewById(R.id.sfvTrack);
    sfvTrack.setZOrderOnTop(true);    // necessary
    SurfaceHolder sfhTrackHolder = sfvTrack.getHolder();
    sfhTrackHolder.setFormat(PixelFormat.TRANSPARENT);
    

提交回复
热议问题