Question

I wanted to add a custom ImageButton on top of my SurfaceView so it essentially scrolls with the View. The canvas scrolls and zooms with a matrix. How could I go about doing this? Thanks.

Was it helpful?

Solution

Assuming I understand the question correctly, can you not just do button.draw(canvas) in your SurfaceView.onDraw() method? You definitely want to bypass the normal layout engine (because it's terribly slow for moving things around) so you'll also have to fake up hit-detection etc.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top