如何链动画机器人以同样的看法? [英] How to chain animation in android to the same view?

查看:112
本文介绍了如何链动画机器人以同样的看法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到了一些文本的意见,我想使MSN的嗡嗡声效果。

I got some text views and I want to make the buzz effect of MSN.

我的计划是:

  • 持有的观点,让说10dip到左侧,
  • 把它回到它的起始位置
  • 在以后把它10dip了
  • 然后返回
  • 下来回
  • 离开...等等。

我的意思是,我有我想设置一种观点认为运动一些序列和需要执行一个接一个。

My point is, I have some sequence of movements that I want to set to one view and that needs to execute one after another.

我怎么能这样做?

推荐答案

使用的 AnimationSet

AnimationSet set = new AnimationSet(true);

Animation animation = new AlphaAnimation(0.0f, 1.0f);
animation.setDuration(100);
set.addAnimation(animation);

animation = new TranslateAnimation(
    Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
    Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f
);
animation.setDuration(500);
set.addAnimation(animation);

view.startAnimation( set );

这篇关于如何链动画机器人以同样的看法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆