How to place UI widgets on top of multiple Z ordered Surface Views in Android

本小妞迷上赌 提交于 2019-12-06 17:06:58

You can use setZOrderMediaOverlay(boolean) to place SurfaceView B over SurfaceView A, but still behind the window. From documentation: Link:

public 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).

So, the following should work for you:

surfaceViewB.setZOrderMediaOverlay(true);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!