Search code examples
androidkotlinimageviewsurfaceview

SurfaceView won't draw while under image view


I have a function that will keep on drawing on the surfaceView to simulate the animation of a character on the surfaceView. But after adding a imageView on top of the SurfaceView, the SurfaceView stop drawing.


Solution

  • setZOrderOnTop(true) you have added in the surfaceview init. because surfaceview should be always on top to draw anything,

    Although after that you can't put image on top of that, for that you can use other question ref add image to surface view in android

    for that. let me know if that helps