-
导入jar包:nineoldandroids-2.4.0(开源动画库);
-
实例化View view;
-
创建动画集:
-
12345678910111213
//1.创建动画集
AnimatorSet set =
new
AnimatorSet();
//2.添加动画
set.playTogether(
ObjectAnimator.ofFloat(view,
"scaleX"
,
2
,
1
.5f,
1
).setDuration(
mDuration),
ObjectAnimator.ofFloat(view,
"scaleY"
,
2
,
1
.5f,
1
).setDuration(
mDuration),
ObjectAnimator.ofFloat(view,
"alpha"
,
0
,
1
)
.setDuration(mDuration *
3
/
2
)
);
//3.开启动画
set.start();
本文转自wauoen51CTO博客,原文链接:http://blog.51cto.com/7183397/1604844
,如需转载请自行联系原作者