android listview每个item定义动画呈现
2013-05-22 23:01
429 查看
文章出处:http://hi.baidu.com/b_lie/item/bcc1880fe257b3c92f4c6b51
LayoutAnimationsController
1、什么是LayoutAnimationsController
LayoutAnimationsController可以用于实现使多个控件按顺序一个一个的显示。
1)LayoutAnimationsController用于为一个layout里面的控件,或者是一个ViewGroup里面的控件设置统一的动画效果。
2)每一个控件都有相同的动画效果。
3)控件的动画效果可以在不同的时间显示出来。
4)LayoutAnimationsController可以在xml文件当中设置,以可以在代码当中进行设置。
2、在xml当中使用LayoutAnimationController
1)在res/anim文件夹下创建一个名为list_anim_layout.xml文件:
android:dylay -动画间隔时间;
android:animationOrder -动画执行的循序(normal:顺序,random:随机,reverse:反向显示)
android:animation –引用动画效果文件
<layoutAnimation
xmlns:android="http://schemas.android.com/apk/res/android"
android:delay="0.5"
android:animationOrder="normal"
android:animation="@anim/list_anim"/>
2)创建list_anim.xml文件,设置动画效果
<?xmlversion="1.0"encoding="utf-8"?>
<setxmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator"
android:shareInterpolator="true">
<alpha
android:fromAlpha="0.0"
android:toAlpha="1.0"
android:duration="1000"/>
</set>
3)在布局文件main.xml当中为ListVIew添加如下配置
<ListView
android:id="@id/android:list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
android:layoutAnimation="@anim/list_anim_layout"/>
LayoutAnimationsController
1、什么是LayoutAnimationsController
LayoutAnimationsController可以用于实现使多个控件按顺序一个一个的显示。
1)LayoutAnimationsController用于为一个layout里面的控件,或者是一个ViewGroup里面的控件设置统一的动画效果。
2)每一个控件都有相同的动画效果。
3)控件的动画效果可以在不同的时间显示出来。
4)LayoutAnimationsController可以在xml文件当中设置,以可以在代码当中进行设置。
2、在xml当中使用LayoutAnimationController
1)在res/anim文件夹下创建一个名为list_anim_layout.xml文件:
android:dylay -动画间隔时间;
android:animationOrder -动画执行的循序(normal:顺序,random:随机,reverse:反向显示)
android:animation –引用动画效果文件
<layoutAnimation
xmlns:android="http://schemas.android.com/apk/res/android"
android:delay="0.5"
android:animationOrder="normal"
android:animation="@anim/list_anim"/>
2)创建list_anim.xml文件,设置动画效果
<?xmlversion="1.0"encoding="utf-8"?>
<setxmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator"
android:shareInterpolator="true">
<alpha
android:fromAlpha="0.0"
android:toAlpha="1.0"
android:duration="1000"/>
</set>
3)在布局文件main.xml当中为ListVIew添加如下配置
<ListView
android:id="@id/android:list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
android:layoutAnimation="@anim/list_anim_layout"/>
相关文章推荐
- android listview每个item定义动画呈现
- android listview每个item定义动画呈现
- android listview每个item定义动画呈现
- android listview每个item定义动画呈现
- android listview每个item定义动画呈现
- android listview每个item定义动画呈现
- Android listView每个item设置不同
- Android实现ListView显示信息,点击每个item,跳转到相应界面
- 给Android ListView添加删除item动画
- android动画(3)layout动画,layoutChanged动画及算定义它,ListViewActivity的Layout动画(代码和xm配置两种实现l)
- android 每个listview的item上都设置一个倒计时 而不错乱、卡顿的一个Demo
- android捕获ListView中每个item点击事件
- listview如何加载动画,实现每个item都有效果
- Android--listview中每个item有多个控件的点击方法
- android捕获ListView中每个item点击事件
- Android ListView的Item上浮动画
- android listview item定义不同的样式布局
- android捕获ListView中每个item点击事件
- ListView滑动Item消失ListView,支持左右滑动位移,支持定义动画时间
- Android—ListView Item 展开动画效果