animation of TextView's text size

前端 未结 3 542
小鲜肉
小鲜肉 2020-12-14 11:42

I want to be able to do a text animation and change the size of the text in a TextView. I read that there are property animations in android but if someone knows a simple co

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-14 12:13

    Animation animation=new TranslateAnimation(0,480,0,0); 
    animation.setDuration(5000);
    animation.setRepeatMode(Animation.RESTART);
    animation.setRepeatCount(Animation.INFINITE);
    text.startAnimation(animation);
    // applying animation to textview object..
    

    If you are using button event to show animation then put the code inside onClick() otherwise use override method onWindowFocusChanged(boolean hasFocus) to start animation

提交回复
热议问题