如何在画布中创建 ScaleAnimation?我的画布上有几个精灵,我想应用 ScaleAnimation。我的代码:
public void onDraw(Canvas canvas){
ScaleAnimation scale = new ScaleAnimation(0, 2, 0, 2);
scale.setInterpolator(new AccelerateDecelerateInterpolator());
scale.setDuration(1000L);
startAnimation(scale);
rect.set(150, 150, 300, 300);
paint.setColor(Color.RED);
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(3);
canvas.drawRoundRect(rect, sizeCage / 10, sizeCage / 10, paint);
}