开发者

How can I add a Button to a custom scrolling and zooming SurfaceView?

开发者 https://www.devze.com 2023-01-31 13:29 出处:网络
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? Thank

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号