How can I add a Button to a custom scrolling and zooming SurfaceView?
I wanted to add a custom ImageButton on top of my SurfaceView so it e开发者_开发技巧ssentially scrolls with the View. The canvas scrolls and zooms with a matrix. How could I go about doing this? Thanks.
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.
精彩评论