Two layers, but can't show the bottom layer in android

强颜欢笑 提交于 2019-12-06 16:49:20

You should not have the imageView behind the SurfaceView, since the SurfaceView is not drawn like regular Views are drawn. The surface is Z ordered so that it is behind the window holding its SurfaceView; the SurfaceView punches a hole in its window to allow its surface to be displayed.

In your case I would place the ImageView in front of the SurfaceView and use setVisibility(View.VISIBLE); when you want to show it.

Alternatively you can use myImageView.bringToFront(); to get it aligned on top of the SurfaceView.

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