- 浏览: 20965 次
最新评论
LayoutAnimationController的使用方法(与ListView结合使用为例)
什么是LayoutAnimationController
1 LayoutAnimationController用于为一个layout里面的控件,或者是一个ViewGroup里面的控件设置动画效果
2 每一个控件都有相同的动画效果
3 这些控件的动画效果在不同的时间显示出来
4 LayoutAnimationController可以在xml文件中设置,也可以在代码中设置
在XML中使用LayoutAnimaionController
1 在res/anim文件夹中创建一个文件,名为list_anim_layout.xml
注意到list_anim这个xml文件,其中配置了动画效果,也就是一个动画配置文件(见5中)
<set>
<alpha...>
</set>
2 在布局文件中为ListView添加如下配置(就是在<listview>标签中添加一个属性)
android:layoutAnimation="@anim/list_anim_layout"
在代码中使用LayoutAnimationController
AnimationListener的使用方法
什么是AnimationListener
1 AnimationListener是一个监听器
2 该监听器在动画执行的各个阶段会得到通知,从而调用相应的方法
3 主要包含下面的三个方法
onAnimationEnd(Animation animation)
onAnimationRepeat(Animation animation)
onAnimationStart(Animation animation)
使用方法:
animation.setAnimationListener(new XxxAnimationListener);
其中XxxAnimationListener继承AnimationListene
在其中实现三个onXXX方法
什么是LayoutAnimationController
1 LayoutAnimationController用于为一个layout里面的控件,或者是一个ViewGroup里面的控件设置动画效果
2 每一个控件都有相同的动画效果
3 这些控件的动画效果在不同的时间显示出来
4 LayoutAnimationController可以在xml文件中设置,也可以在代码中设置
在XML中使用LayoutAnimaionController
1 在res/anim文件夹中创建一个文件,名为list_anim_layout.xml
<layoutAnimation xmlns:android="http://schemas.android.com/apk/res/android" android:delay="0.5" android:animationOrder="random" android:animation="@anim/list_anim" />
注意到list_anim这个xml文件,其中配置了动画效果,也就是一个动画配置文件(见5中)
<set>
<alpha...>
</set>
2 在布局文件中为ListView添加如下配置(就是在<listview>标签中添加一个属性)
android:layoutAnimation="@anim/list_anim_layout"
在代码中使用LayoutAnimationController
1 创建一个Animation对象: 可以通过装载xml,也可以直接使用Animation的构造函数创建Animation对象 2 创建LayoutAnimationController对象 LayoutAnimationController lac=new LayoutAnimationController(animation); 3 设置控件显示顺序 lac.setOrder(LayoutAnimationController.ORDER_NORMAL); 4 为ListView设置LayoutAnimationController属性: listView.setLayoutAnimation(lac);
AnimationListener的使用方法
什么是AnimationListener
1 AnimationListener是一个监听器
2 该监听器在动画执行的各个阶段会得到通知,从而调用相应的方法
3 主要包含下面的三个方法
onAnimationEnd(Animation animation)
onAnimationRepeat(Animation animation)
onAnimationStart(Animation animation)
使用方法:
animation.setAnimationListener(new XxxAnimationListener);
其中XxxAnimationListener继承AnimationListene
在其中实现三个onXXX方法
发表评论
-
SQLite数据库
2011-10-21 11:12 9911。从www.sqlite.org下载SQLite 3.3.4 ... -
android中的有道词典实例
2011-10-19 22:51 8961、布局文件main.xml <?xml version ... -
mars老师的googleMap示例(二)
2011-10-15 17:14 845manifest.xml文件 <?xml version ... -
mars老师的googleMap(一)
2011-10-15 10:43 789一、申请 Apikey Apikey Apikey Apike ... -
Intent在android中的几种用法
2011-10-14 09:26 753如果是从BroadcastReceiver 启动一个新的Act ... -
基于Service与ContentProvider的音乐播放实例
2011-10-13 23:37 726Android的核心也就是Activi ... -
android之用户定位(一)
2011-10-13 19:53 16651、User Location 能做什么 1) 获取用户的位置 ... -
android之蓝牙操作(二)
2011-10-13 18:43 12711、修改本蓝牙设备的可见性 2、扫描周围可用蓝牙设备 步骤: ... -
android之蓝牙操作(一)
2011-10-13 16:35 1206与蓝牙相关的API 1、BluetoothAdapter ... -
Android学习之JSON数据解析
2011-10-12 13:30 676在Android应用开发中,常用的数据交换格式有XML和JSO ... -
android中的JSON解析
2011-10-12 10:17 8841 。 什么是JSON 就是现在网络上比较流行 ... -
Animations的使用(五)
2011-10-11 17:41 7021 AnimationSet的使用方法 什么是Animat ... -
Animations使用 (四)
2011-10-11 17:36 548Animations的第二种使用方法(第一种见1) 步骤: ... -
android面试
2011-10-10 21:12 762为什么要用ContentProvider?它和sql的实现上有 ... -
android中的animations的用法(三)
2011-10-10 21:07 690一 LayoutAnimationController ... -
android中的animations的用法(二)
2011-10-10 20:59 766一 AnimationSet 的用法 二 Interpol ... -
android中的animations的用法 (一)
2011-10-10 20:56 1305Animations 可分为两大类: 一 Tweened A ...
相关推荐
常用动画效果 Animations 常用写法主要是两种 见代码
14个3d箭头样式与动画,非常好~可以自己修改使用,14+Arrow+Animations+1.0.unitypackage
James Cabello Animations.7z删
SVG Animations.pdf SVG Animations.pdf SVG Animations.pdf SVG Animations.pdf SVG Animations.pdf SVG Animations.pdf
Creating Web Animations 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
animations
Mega Animations Pack.unitypackage Mega Animations Pack.unitypackage Mega Animations Pack.unitypackage
Animations.scml
Magic CSS3 Animations 是 CSS3 动画的包,伴有特殊的效果,用户可以自由的在 web 项目中使用。Magic CSS3 Animations 结构非常简单,包括 CSS 样式:magic.css 或者是 mynified 版本:magic.min.css。 ...
View Animations 2. Auto Layout 3. Layer Animations 4. View Controller Transition Animations 5. Animations with UIViewPropertyAnimator 6. 3D Animations 7. Further Types of Animations
Animations 动画展示 轮播广告优化 常用动画界面展示 基层代码
Creating Web Animations_ Bringi - Kirupa Chinnathambi
iOS Animations by Tutorials v4.0 iOS Animations by Tutorials v4.0
iOS Animations 动画 swift ios10
Crowd Animations 是一个开箱即用的解决方案,支持在高性能场景中使用大量的动画角色。CA (Crowd Animations) 采用 GPU Instancer 核心功能,并在 GPUI 间接实例化解决方案和 GPU 剔除技术的基础上增加了 GPU 蒙皮...
Creating Web Animations Bringing your UIs to Life 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
iOS Animations by Tutorials v4.0 iOS Animations by Tutorials v4.0
详细解释了Android的animation四种类型:alpha、scale、translate、rotate,及其在代码中的获取与使用
Crowd Animations is an extension for GPU Instancer, and requires it to work. Support Forum | Documentation | F.A.Q. Crowd Animations is an out of the box solution for using massive amounts of ...
游戏动作库