How to create a count-up effect for a textView in Android

后端 未结 6 1499
隐瞒了意图╮
隐瞒了意图╮ 2020-12-13 07:17

I am working on an app that counts the number of questions marks in a few paragraphs of text.

After the scanning is done (which takes no time at all) I would love to

6条回答
  •  醉梦人生
    2020-12-13 08:02

    Use TextSitcher

    for the best effects. It will transform the text softly.

    When coming to the change of the text use the below Code.

    > int number = 0;
    >         Timer obj = new Timer();
    >         TimerTask tt = new TimerTask() {
    >                       @Override           public void run() {
    >               // TODO Auto-generated method stub
    >               textView.setText(number++);
    >               if(number < score)
    >               obj.schedule(tt, 200);          }       };
    >         obj.schedule(tt, 200);
    

提交回复
热议问题