Android View.onDraw() always has a clean Canvas

后端 未结 3 1403
误落风尘
误落风尘 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 08:51

    you should have a look here to see the difference between basic view and surfaceView. A surfaceView has a dedicated layer for drawing, which I suppose keeps track of what you drew before. Now if you really want to do it on a basic View, you could try to put each item you draw in an array, like the exemple of itemized overlay for the mapview. It should work pretty much the same way

提交回复
热议问题