GLSurfaceView/SurfaceView overlap

后端 未结 3 1132
被撕碎了的回忆
被撕碎了的回忆 2021-01-15 04:21

I asked a question about this earlier but received no responses, so I\'m trying again.

I need to do a rendered 2D picture with some accompanying labels and graphics

相关标签:
3条回答
  • 2021-01-15 04:57

    we should set setZOrderMediaOverlay and setZOrderOnTop to true value

    setZOrderMediaOverlay

    Added in API level 5 void setZOrderMediaOverlay (boolean isMediaOverlay) Control whether the surface view's surface is placed on top of another regular surface view in the window (but still behind the window itself). This is typically used to place overlays on top of an underlying media surface view.

    Note that this must be set before the surface view's containing window is attached to the window manager.

    Calling this overrides any previous call to setZOrderOnTop(boolean).

    setZOrderOnTop

    Added in API level 5 void setZOrderOnTop (boolean onTop) Control whether the surface view's surface is placed on top of its window. Normally it is placed behind the window, to allow it to (for the most part) appear to composite with the views in the hierarchy. By setting this, you cause it to be placed above the window. This means that none of the contents of the window this SurfaceView is in will be visible on top of its surface.

    Note that this must be set before the surface view's containing window is attached to the window manager.

    Calling this overrides any previous call to setZOrderMediaOverlay(boolean).

    Please refer to this link : http://developer.android.com/reference/android/view/SurfaceView.html#setZOrderMediaOverlay(boolean)

    0 讨论(0)
  • 2021-01-15 05:12

    The way SurfaceViews work will make it impossible to do what you want. You will have to render your text inside the GLSurfaceView.

    0 讨论(0)
  • 2021-01-15 05:14

    Never try to overlap a GLSurfaceView with anything (above or below). At best it breaks on your device and you catch it early, at worst it works on one device and not others. Bite the bullet and do everything in a GL view or none of it. If you need the speed then GL is the way to go.

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