コード:ここで下から始めるのではなく、固定された場所から画像を上下に移動するには?私は現在、使用しています
TranslateAnimation mAnimation = new TranslateAnimation(
TranslateAnimation.ABSOLUTE, 0f,
TranslateAnimation.ABSOLUTE, 0f,
TranslateAnimation.RELATIVE_TO_PARENT, 0f,
TranslateAnimation.RELATIVE_TO_PARENT, 1.0f);
mAnimation.setDuration(2000);
mAnimation.setRepeatCount(-1);
mAnimation.setRepeatMode(Animation.REVERSE);
mAnimation.setInterpolator(new LinearInterpolator());
imageView.setAnimation(mAnimation);
はresult.(画像品質を無視し、私はそれを変更します)です。
イメージを水平中央に配置しました。フローティングアクションボタンに垂直に配置しました。私はそれがそこから始めることを望む。
また、オプションで、フェードインフェードアウトAlphaAnimation
を作成しました。どちらを同期させるのですか? AlphaAnimationため
コード:
AlphaAnimation blinkAnimation = new AlphaAnimation(1, 0); // Change alpha from fully visible to invisible
blinkAnimation.setDuration(1000); // duration - half a second
blinkAnimation.setInterpolator(new LinearInterpolator()); // do not alter animation rate
blinkAnimation.setRepeatCount(5000); // Repeat animation infinitely
blinkAnimation.setRepeatMode(Animation.REVERSE);
おかげで、これは助けないが、今の画像ちょっと高すぎる、前にそれを止める方法?あるいは、 'TranslateAnimation'のパラメータを説明できたら、私は自分自身を試すことができます。 –
前に停止したい場合は、TranslateAnimation.RELATIVE_TO_SELF、-1.0fを変更してください。 TranslateAnimation.RELATIVE_TO_SELF、-0.5f)に; –
これは、ありがとうございます。 –