android listview每个item定义动画呈现
2016-03-03 23:59
501 查看
转载 地址:http://blog.sina.com.cn/s/blog_4d6fba1b0101hag7.html
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"/>
分享:
16
喜欢
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"/>
分享:
16
喜欢
相关文章推荐
- Android连连看源码---百度文库
- Android里EditText按删除键没反应的解决方法
- Android View(二)-View的scrollTo()以及scrollBy()说明
- Android View(一)-View坐标以及方法说明
- android线程小结
- 使用MAT查看Android内存泄露
- 2016-3-3
- 深入理解Android内核设计思想——读书笔记
- Android中的ImageView的设置
- Android ListView中处理嵌套滑动问题,类似ScrollView嵌套ListView
- 《Android开发艺术探索》读书笔记 (3) 第3章 View的事件体系
- Crashlytics
- Android 代码中文字在手机上显示乱码问题解决方法
- Android中AIDL进程间通信
- 专业相框设计(ImageView的堆栈应用)
- Android开发环境下载与搭建
- android textview 莫名其妙 换行了?
- android_TimePicker
- Android内存解析(二)— 详解内存,内部存储和外部存储
- Android学习笔记之Intent(1)