zoukankan      html  css  js  c++  java
  • Android-LayoutAnimation

    Android-LayoutAnimation

    学习自

    《Android开发艺术探索》

    LayoutAnimation漫谈

    LayoutAnimation 也是View动画的一种,作用是为ViewGroup的ChildView添加出场动画,我们经常回看到一些ListView的Item的出场效果很漂亮,就是通过LayoutAnimation实现的。

    LayoutAnimation

    layoutanimation.gif | left | 369x539

    首先还是在 res/anim 目录下建立LayoutAnimation的Xml文件

    <?xml version="1.0" encoding="utf-8"?>
    <layoutAnimation xmlns:android="http://schemas.android.com/apk/res/android"
        android:animation="@anim/item_in_set"
        android:animationOrder="normal"
        android:delay="0.2" />
    

    属性解释

    • animation: ChildView的入场动画
    • animationOrder: 动画播放的顺序,其中有三个选项
      • normal 顺序显示
      • random 随机显示
      • reverse
    • delay 表示ChildView播放属性动画的延迟时间,假如说ViewChild动画播放的时间是300毫秒,那么 0.2 表示每个ChildView的动画播放都要比上一个ChildView的播放时间延迟 60毫秒 ,这样就有一个ChildView依次播放的特效了。

    item_in_set 动画

    <?xml version="1.0" encoding="utf-8"?>
    <set xmlns:android="http://schemas.android.com/apk/res/android"
        android:duration="300">
        <alpha
            android:fromAlpha="0"
            android:toAlpha="1" />
        <translate
            android:fromYDelta="50%"
            android:toYDelta="0" />
    </set>
    
  • 相关阅读:
    ORB Test Hanson
    ajax异步传输中的乱码问题
    调用淘宝API遇到的问题
    doc命令查看电脑配置大全
    从关联数组中取得键名
    php图片上传
    doc命令查看电脑配置
    一个空间配置多个虚拟主机
    淘客网站中系统信息获取
    opendir(path,context)
  • 原文地址:https://www.cnblogs.com/slyfox/p/9353114.html
Copyright © 2011-2022 走看看