属性动画
来源:互联网 发布:八爪鱼采集淘宝评论 编辑:程序博客网 时间:2024/06/05 14:21
img1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) {// ObjectAnimator//动画的执行类// .ofFloat(view, "rotationY", 0.0F, 360.0F)// .setDuration(5000)//动画持续时间// .start(); //多个动画一起执行// ObjectAnimator anim1 = ObjectAnimator.ofFloat(view, "scaleX",// 1.0f, 2f);// ObjectAnimator anim2 = ObjectAnimator.ofFloat(view, "scaleY",// 1.0f, 2f);// ObjectAnimator anim3 = ObjectAnimator.ofFloat(view, "rotationY", 0.0f, 360.0f);// AnimatorSet animSet = new AnimatorSet();// animSet.setDuration(2000);// // animSet.setInterpolator(new LinearInterpolator());// //三个动画同时执行// animSet.playTogether(anim1, anim2, anim3);// animSet.start(); //ValueAnimation// ValueAnimator anim = ValueAnimator.ofFloat(0f, 100f);// anim.setRepeatMode(ValueAnimator.REVERSE);// anim.setRepeatCount(2);// anim.setDuration(3000);// anim.setTarget(view);// anim.start(); //淡入淡出 anim1 = ObjectAnimator .ofFloat(view, "alpha", 1f, 0f, 1f) .setDuration(5000); //以Y轴旋转 anim2 = ObjectAnimator .ofFloat(view, "rotationY", 0.0F, 360.0F) .setDuration(5000); //大小调整 anim3 = ObjectAnimator .ofFloat(view, "scaleY", 1.0f, 2f) .setDuration(5000); anim4 = ObjectAnimator .ofFloat(view, "scaleX", 1.0f, 2f) .setDuration(5000); anim5 = ObjectAnimator .ofFloat(view, "rotationX", 360.0F, 0.0F) .setDuration(5000);// 播放anim1;// 同时播放anim2,anim3,anim4;// 播放anim5。 AnimatorSet bouncer = new AnimatorSet(); bouncer.play(anim1).before(anim2); bouncer.play(anim2).with(anim3); bouncer.play(anim2).with(anim4); bouncer.play(anim5); bouncer.start(); } }); }
0 0
- 属性动画
- 属性动画
- 属性动画
- 属性动画
- 属性动画
- 属性动画
- 属性动画
- 属性动画
- 属性动画
- 属性动画
- 属性动画
- 属性动画
- 属性动画
- 属性动画
- 属性动画
- 属性动画
- 属性动画
- 属性动画
- php文字水印和php图片水印实现代码
- Json数据的解析
- CNN卷积神经网络--反向传播(3,Notes on Convolutional Neural Networks)
- C/C++之多级指针和结构体
- 24. Swap Nodes in Pairs
- 属性动画
- 常用的点赞效果的代码实现
- shell中&&和||的使用方法
- Android ADB命令集合
- 用ctags在终端下查看代码
- Linux设备驱动--LCD平台设备与驱动(smdk2440)
- 合并果子
- CNN卷积神经网络--反向传播(4,代码理解)
- Solr文档学习--Using the Solr Administration User Interface