Android View.onDraw() always has a clean Canvas

后端 未结 3 1401
误落风尘
误落风尘 2020-12-01 08:15

I am trying to draw an animation. To do so I have extended View and overridden the onDraw() method. What I would expect is that each time onDraw() is called the canvas wou

3条回答
  •  粉色の甜心
    2020-12-01 09:02

    Your expectations do not jib w/ reality :) The canvas will not be the way you left it, but it blank instead. You could create an ArrayList of objects to be drawn (canvas.drawCircle(), canvas.drawBitmap() etc.), then iterate though the ArrayList in the OnDraw(). I am new to graphics programming but I have used this on a small scale. Maybe there is a much better way.

提交回复
热议问题