how to put an image view on top of a surfaceview android

I have Surface view which i have set the setZOrderOnTop(true); When i have recorded a video on this view, set display of the media player to this view and then I set the visibility of images over it to true I can see the images over this surface view.

Now when I set the mediaplayer.start() the video plays but the images over this surface view disappear, and they aren't even visible even after I explicitly set surfaceview setZOrderOnTop(false); and the visibility of the images to Visible in onCompletion of the media player. But the imageviews onclick is enabled

Please help me solve this.


The View UI is on one layer, the SurfaceView Surface is on a different layer. You can put the SurfaceView Surface in front of or behind the View elements, but you can't put it between Views, and you can't change the position once the Surface has been created:

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

You can solve it on API 14+ by sending your video to a TextureView instead. TextureViews are less efficient, but can be manipulated in the layout like any other View.

链接地址: http://www.djcxy.com/p/66778.html

上一篇: 在Windows上测试ARM特定代码的最简单方法

下一篇: 如何将图像视图放在surfaceview android上