1

我试图让一个圆圈在 3 秒后出现并在 3 秒后消失。

public class TestView extends View{

public TestView(Context context) {
    super(context);
    // TODO Auto-generated constructor stub
}

@Override
protected void onDraw(Canvas canvas) {
    // TODO Auto-generated method stub
    super.onDraw(canvas);
    canvas.drawColor(Color.RED);

    Paint circle = new Paint();
    circle.setColor(Color.BLUE);


    CountDownTimer count = new CountDownTimer(3000, 1000) {

        public void onTick(long millisUntilFinished) {

        }

        public void onFinish() {

            CountDownTimer count = new CountDownTimer(3000, 1000) {

                public void onTick(long millisUntilFinished) {
                    canvas.drawCircle(100, 100, 40, circle);

                }

                public void onFinish() {

                }

             }.start();

        }

     }.start();



}

这种方式是完成这项任务的好方法吗?但他让我把画布和绘画作为最终作品。我应该如何删除这个圈子?

4

0 回答 0