zoukankan      html  css  js  c++  java
  • Android中res下anim和animator文件夹区别与总结

    1、anim文件夹

    anim文件夹下存放tween animation(补间动画)和frame animation(逐帧动画)

    逐帧动画:

        ①在animation-list中使用item定义动画的全部帧,并指定各帧的持续时间

        ②将xml文件作为View控件的背景

        ③AnimationDrawable animationDrawable = (AnimationDrawable)View.getDrawable()

        ④animationDrawable.start().

    补间动画:

        ①xml文件里只有sacle(缩放效果)、rotate(旋转效果)、translate(移动效果)、alpha(淡入淡出效果)、set五个标签

        ②在代码中使用AnimationUtils.loadAnimation()方法加载动画

        ③使用View.setAnimation(Animation)为View控件加载动画,使用View.startAnimation()开启动画

        ④通用属性:

            a.android:duration:设置动画持续时间

            b.android:fillAfter:如果fillAfter为true,则动画执行后,控件将停留在动画结束的状态

            c.android:fillBefore:如果fillBefore为true,则动画执行后,控件将回到动画开始的状态

            d.android:startOffset(long startOffset):设置动画执行前等待的时间(单位:毫秒)

            e.android:interpolator:设置动画的变化速度

    2、animator文件夹

    ①animator文件夹下存放property animation(属性动画)

    ②xml文件里有animator、objectAnimator、set三个标签

    ③在代码中使用AnimatorInflater.loadAnimator()方法加载动画

    ④使用Animator.setTarget(View)为View控件加载动画,使用Animator.start()开启动画
    ————————————————
    版权声明:本文为CSDN博主「小不懂0706」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/u014611408/article/details/96482832

  • 相关阅读:
    C#线程的IsBackgroud属性动态设置
    asp.net 异步
    IBM一些Java文章
    (一)Apollo配置中心介绍
    样式表中的 element.style样式如何修改
    jquery中的append和js原生中的innerhtml的区别
    如何在datagrid中的column获取json数据
    快速排序
    冒泡排序
    二进制中有多少个1?
  • 原文地址:https://www.cnblogs.com/Im-Victor/p/11445598.html
Copyright © 2011-2022 走看看