Android布局动画
来源:互联网 发布:protobuf3 java 编辑:程序博客网 时间:2024/05/06 03:34
布局动画作用在ViewGroup上,用来给ViewGroup增加View的时候添加动画的过度效果。
最简单的使用,给ViewGroup加上
android:animateLayoutChanges="true"当布局变化的时候回显示Android默认的过度效果,缺点:无法使用自定义的动画替换这个效果。
我们可以使用LayoutAnimationController自定义一个子View的过度效果。
private void layoutAnimationController() { RelativeLayout rl = (RelativeLayout) findViewById(R.id.rl); ScaleAnimation scaleAnimation = new ScaleAnimation(0,1,0,1); scaleAnimation.setDuration(1000); LayoutAnimationController animationController = new LayoutAnimationController(scaleAnimation,0.5f); animationController.setOrder(LayoutAnimationController.ORDER_REVERSE); rl.setLayoutAnimation(animationController); }
LayoutAnimationController的第一个参数是要作用的动画,第二个参数是每个子View显示的delay时间,当delay不为0的时候,可以设置子View的显示顺序。
LayoutAnimationController.ORDER_NORMAL:顺序LayoutAnimationController.ORDER_REVERSE:反序LayoutAnimationController.ORDER_RANDOM:随机
0 0
- android属性动画--布局动画
- android-帧动画、布局动画
- Android动画--布局动画 LayoutAnimation
- Android动画之布局动画
- Android动画--布局动画 LayoutAnimation
- Android的动画布局
- android布局改变动画
- Android布局动画
- android 布局动画
- android布局动画
- Android布局动画
- Android布局动画
- android-布局动画笔记
- Android布局动画--LayoutTransition
- Android布局动画
- android 动画 弹出动画 控件 布局 动画
- Android-Animation动画(变换动画,帧动画,布局动画)
- Android 动画(一)---布局动画
- How to install sublime text 3 in ubantu linux
- python sh package can't execute in crontab[sh.CommandNotFound]
- HTML基础3
- Python的random
- 用JS替 <input type=file>的value属性动态赋值
- Android布局动画
- Qt-第一个白窗口程序
- 栈的顺序存储实现
- 8月21号晚11点40,人生第一次开博客
- html介绍。
- pcap文件概述
- java基础学习之文件拷贝 字节流
- 第一行代码:知晓当前是哪个界面
- 线性表(1)