Animation的使用(四)
来源:互联网 发布:windows基于什么内核 编辑:程序博客网 时间:2024/06/08 05:46
什么是LayoutAnimationControler:
1,用于为一个layout里面的控件或者ViewGroup里面的控件设置动画效果。
2,每一个控件都有相同的动画效果。
3,这些控件的动画在不同时间显示出来。
4,LayoutAnimationControler可以在xml中设置,也可以在代码中设置。
1. LayoutAnimationController用于为一个Layout里面的控件或者是Viewgroup的控件设置动画效果。。
2.每一个控件都会有相同的动画效果
3.这些动画效果在不同的时间现实出来
4.LayoutAnimationController不仅可以在Layout里面实现也可以在代码中实现。。
怎么样在xml中使用LayoutAnimationController:
1在res/anim文件夹中创建一个新文件名为list-item-layout.xml文件
?xml version="1.0" encoding="utf-8"?>
<layoutAnimation xmlns:android="http://schemas.android.com/apk/res/android"
android:delay="2"
android:animationOrder="normal"
android:animation="@anim/list_anim" />
2在布局文件当中添加如下配置
android:layoutAnimation=“@anim/list_item_layout”
在代码中使用LayoutAnimationController
1.创建一个Animation对象,可以通过装载xml文件 也可以通过构造函数构造对象
2.使用如下代码创建LayoutAnimationController
LayoutAnimationController lac=new LayoutAnimationController(animation);
3.设置控件显示的顺序
lrc.setOrder(LayoutAnimationController.ORDER_NORMAL)
4.为ListView设置LayoutAnimationController属性
listview.setLayoutAnimation(lac);
Animation animation = (Animation)AnimationUtils.loadAnimation(MainActivity.this, R.anim.list_anim);
LayoutAnimationController lac = new LayoutAnimationController(animation);
lac.setOrder(LayoutAnimationController.ORDER_NORMAL);
lac.setDelay(0.5f);
listView.setLayoutAnimation(lac)
- Animation的使用(四)
- 传统动画Animation的四种基础动画的使用
- 传统动画Animation的四种基础动画的使用
- 传统动画Animation的四种基础动画的使用
- NGUI实用操练(四)NGUI的Animation组件是怎么用的 之 浅显使用【NGUI2.6.3】
- Core Animation 四 (三维动画)
- Android Animation(四)AnimationListener
- Animation动画效果的实现(四)------总结
- Unity Mecanim动画的实现(四):Animation Controller设置
- Unity Mecanim动画的实现(四):Animation Controller设置
- android简易时钟(animation的使用)
- 属性动画(Property Animation)的使用
- Animation的巧妙使用
- Animation的巧妙使用
- android Animation的使用
- 关于Animation的使用
- -webkit-animation的使用
- animation的使用
- 编程珠玑第八章-算法设计技术
- php cannot load php5apache2_2.dll
- vs 2005 Unicode 转 ANSI
- 30+免费快速启动工具软件下载
- 静态变量和静态方法
- Animation的使用(四)
- C语言使用注意事项(四)
- activity之生命周期(笔记)
- 关于工作后定居城市的思考以及房价预测(天涯原创)
- xheditor应用
- 文件批量 复制 粘贴 删除 格式限定
- 为Extjs 树提供数据的递归算法
- <filter-mapping>中的<dispatcher>元素
- 图像处理基本算法 动态阈值分割