android布局动画
来源:互联网 发布:啪啪啪软件下载 编辑:程序博客网 时间:2024/04/30 01:46
布局动画就是给一个ViewGroup设置其子View的动画。
通过LayoutAnimationController类来定义一个子View的过渡效果。
然后将其作用在ViewGroup上。
代码如下:
LinearLayout ll = (LinearLayout) findViewById(R.id.ll);
ScaleAnimation sa = new ScaleAnimation(0, 1, 0, 1);
sa.setDuration(2000);
//LayoutAnimationController的第一个参数是动画,第二个参数是子View显示的
//延迟时间。
LayoutAnimationController lac = new LayoutAnimationController(sa, 0.5F);
//设置子View显示的顺序,一共三个顺序。
//LayoutAnimationController.ORDER_NORMAL--顺序
//LayoutAnimationController.ORDER_RANDOM--随机
//LayoutAnimationController.ORDER_REVERSE--反序
lac.setOrder(LayoutAnimationController.ORDER_RANDOM);
给LinearLayout设置布局动画
ll.setLayoutAnimation(lac);
通过LayoutAnimationController类来定义一个子View的过渡效果。
然后将其作用在ViewGroup上。
代码如下:
LinearLayout ll = (LinearLayout) findViewById(R.id.ll);
ScaleAnimation sa = new ScaleAnimation(0, 1, 0, 1);
sa.setDuration(2000);
//LayoutAnimationController的第一个参数是动画,第二个参数是子View显示的
//延迟时间。
LayoutAnimationController lac = new LayoutAnimationController(sa, 0.5F);
//设置子View显示的顺序,一共三个顺序。
//LayoutAnimationController.ORDER_NORMAL--顺序
//LayoutAnimationController.ORDER_RANDOM--随机
//LayoutAnimationController.ORDER_REVERSE--反序
lac.setOrder(LayoutAnimationController.ORDER_RANDOM);
给LinearLayout设置布局动画
ll.setLayoutAnimation(lac);
0 0
- android属性动画--布局动画
- android-帧动画、布局动画
- Android动画--布局动画 LayoutAnimation
- Android动画之布局动画
- Android动画--布局动画 LayoutAnimation
- Android的动画布局
- android布局改变动画
- Android布局动画
- android 布局动画
- android布局动画
- Android布局动画
- Android布局动画
- android-布局动画笔记
- Android布局动画--LayoutTransition
- Android布局动画
- android 动画 弹出动画 控件 布局 动画
- Android-Animation动画(变换动画,帧动画,布局动画)
- Android 动画(一)---布局动画
- 从PLC到PHP
- 聚焦里约奥运赛场,为你锁定每一刻精彩瞬间
- Oracle10g 安装步骤
- 漫步微积分十八——变化率问题
- 去掉字符串中连续出现k个0的字串
- android布局动画
- html5元素拖动
- Notification的使用
- 数据结构实验之查找四:二分查找
- C3P0方法中fanh类型转换
- toolar与drawerlayout的使用
- 为什么php要学习面象对象编程
- android布局优化
- hdu-5818-Joint Stacks-栈模拟/左偏树