首页 > 移动平台 > 详细

thinking for android's animation

时间:2016-03-07 01:28:31      阅读:189      评论:0      收藏:0      [点我收藏+]

*Property Animation
ObjectAnimator anim=ObjectAnimator.ofFloat((textView, "asdfasdf", 0F, 1F);
anim.setDuration(2000);
anim.addUpdateListener(new AnimatorUpdateListener() {
//当ObjectAnimator需要更新TextView的属性时
public void onAnimationUpdate(ValueAnimator animation) {
Float value=(Float)animation.getAnimatedValue();
textView.setAlpha(value);
textView.setScaleX(value);
textView.setScaleY(value);
}
});
anim.start();

*Frame Animation 帧动画
1>构建AnimationDrawable对象。
anim=new AnimationDrawable();
2>向AnimationDrawable对象中添加帧
anim.addFrame()
3>调用view.setBackground(anim)
4>anim.start()

thinking for android's animation

原文:http://www.cnblogs.com/gentspy/p/5249133.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!