How to make the GLSurfaceView transparent

前端 未结 2 1750
庸人自扰
庸人自扰 2021-01-24 21:57

I am drawing the object on GLSurfaceView using opengles. But GLSurfaceView is not the transparent. Instead of transparent its completely black in background.

Please help

2条回答
  •  别那么骄傲
    2021-01-24 22:25

    You should add a another property for it:

    getHolder().setFormat(PixelFormat.TRANSLUCENT);
    
    // this made it work for me - works only from sdk level 6 on, though....
    
    glview.setZOrderOnTop(true);
    

提交回复
热议问题