snippet
2022-08-02 本文已影响0人
xiaoluo
@Override
protected void onDraw(Canvas canvas) {
// Translate rotation axe to the center.
canvas.translate(canvas.getWidth()/2, canvas.getHeight()/2);
// Rotate!
canvas.rotate(rotation(3));
// Put back to its original place.
canvas.translate(-canvas.getWidth()/2, -canvas.getHeight()/2);
// Invalidate the view.
postInvalidateOnAnimation();
super.onDraw(canvas);
}
view.postOnAnimation(runnable);