android属性动画
2017-11-22 11:00
162 查看
//透明度 ObjectAnimator alpha = ObjectAnimator.ofFloat( img, "alpha", 0, 1 ); alpha.setDuration(3000); alpha.start(); //旋转 ObjectAnimator rotation = ObjectAnimator.ofFloat( img, "rotation", 10, 360 ); rotation.setDuration(3000); rotation.start(); //平移 ObjectAnimator translationX = ObjectAnimator.ofFloat( img, "translationX", 0, 50 ); translationX.setDuration(3000); translationX.setRepeatCount(3); translationX.start(); //缩放 ObjectAnimator scaleX = ObjectAnimator.ofFloat( img, "scaleX", 0, 1 ); scaleX.setDuration(3000); scaleX.start(); // 动画自定义差值器 // 先加速后减速 animatr.setInterpolator(new AccelerateDecelerateInterpolator()); // 加速 animatr.setInterpolator(new AccelerateInterpolator()); // 减速 animatr.setInterpolator(new DecelerateInterpolator()); // 匀速 animatr.setInterpolator(new LinearInterpolator());
相关文章推荐
- Android开发笔记之属性动画解析
- Android属性动画完全解析(中)
- Android——属性动画
- Android之Animation动画各属性的参数意思(二)
- Android属性动画LayoutTransition(布局容器动画)
- Android: Property Animation 属性动画的使用
- Android属性动画入门介绍
- Android之属性动画
- android中对于非属性动画的整理
- Android中属性动画解析
- Android之属性动画Animator
- Android属性动画-Property Animation(四) 组合动画
- Android属性动画完全解析(下),Interpolator和ViewPropertyAnimator的用法
- 《转载》android 属性动画Property Animation学习
- Android属性动画---Property Animation(二)
- Android动画中属性fillafter和fillbefore的正确理解
- Android动画详解(二)属性动画完全解析(上)
- Android属性动画完全解析(中),ValueAnimator和ObjectAnimator的高级用法
- Android动画(二)-属性动画
- Android中的属性动画(Property Animation)——Android开发艺术探索笔记