Android drawing button to canvas with custom view?

后端 未结 3 809
醉梦人生
醉梦人生 2020-12-09 11:34

How can I draw a button on top of the canvas in a custom view? (Preferably on the mid-right side) Is there something I have to call before doing the button.draw(canvas)?

3条回答
  •  孤街浪徒
    2020-12-09 12:03

    Try this

    public onDraw(Canvas canvas) {
           super.onDraw(canvas);
           canvas.save();
           pauseButton.draw(canvas);
           canvas.restore();
    }
    

提交回复
热议问题