【问题标题】:Translate Animation Issue in Android在 Android 中翻译动画问题
【发布时间】:2015-08-05 11:26:52
【问题描述】:

我是Android新手,我尝试制作翻译动画。

这是我的 xml 代码:(rail.xml)

<translate
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:fromXDelta="100%p"
 android:toXDelta="0"
 android:duration="4000" />

这是我的java代码:

final Animation animShow = AnimationUtils.loadAnimation( this, R.anim.rail);
for(int i = 1; i < 5; i++ ){

    animShow.setRepeatCount(i);

    textTV.setText("Hello Android!!");
    textTV.startAnimation(animShow);
}

我想问,如何更改每个动画重复的文字?

【问题讨论】:

    标签: android text translate-animation


    【解决方案1】:

    通过setAnimationListener() 注册一个AnimationListener,并在侦听器的onAnimationRepeat() 方法中更改您的文本。

    【讨论】:

      最近更新 更多