how to build a GUI/HUD over top a glSurfaceView in android

后端 未结 1 978
南方客
南方客 2021-01-07 14:01

I have an glSurfaceView that looks like this:

public class GLLayer extends GLSurfaceView implements SurfaceHolder.Callback, Camera.PreviewCallba         


        
1条回答
  •  失恋的感觉
    2021-01-07 14:42

    After almost a year I came back to this and found the following solution to work like a charm.. I know many have battled with this same issue so I thought I'd share to save anyone the aggravation I endured.

    Simple: before adding my views to the frame layout I set the glView's zOrderMediaOverlay to TRUE like so:

    glView.setZOrderMediaOverlay(true);
    rel.addView(camPreview, camParams);
    rel.addView(glView, glParams);
    rel.addView(imageView, imageParams);
    

    0 讨论(0)
提交回复
热议问题