Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在我的 SurfaceView 上添加一个自定义 ImageButton,这样它就可以随着视图滚动。画布使用矩阵滚动和缩放。我怎么能这样做呢?谢谢。
假设我正确理解了这个问题,你能不能只button.draw(canvas)用你的SurfaceView.onDraw()方法做?你肯定想绕过正常的布局引擎(因为移动东西非常慢)所以你还必须伪造命中检测等。
button.draw(canvas)
SurfaceView.onDraw()