Animating Layout Changes 动画布局的更改
来源:互联网 发布:深汕联通数据机房地址 编辑:程序博客网 时间:2024/05/17 21:55
A layout animation is a pre-loaded animation that the system runs each time you make a change to the layout configuration. All you need to do is set an attribute in the layout to tell the Android system to animate these layout changes, and system-default animations are carried out for you.
Tip: If you want to supply custom layout animations, create aLayoutTransition
object and supply it to the layout with thesetLayoutTransition()
method.
If you want to jump ahead and see a full working example, download and run the sample app and select the Crossfade example. See the following files for the code implementation:
src/LayoutChangesActivity.java
layout/activity_layout_changes.xml
menu/activity_layout_changes.xml
Create the Layout
In your activity's layout XML file, set the android:animateLayoutChanges
attribute totrue
for the layout that you want to enable animations for. For instance:
<LinearLayout android:id="@+id/container" android:animateLayoutChanges="true" .../>
Add, Update, or Remove Items from the Layout
Now, all you need to do is add, remove, or update items in the layout and the items are animated automatically:
private ViewGroup mContainerView;...private void addItem() { View newView; ... mContainerView.addView(newView, 0);}
- Animating Layout Changes 动画布局的更改
- Android Animating Layout Changes布局的默认动画
- Animating Layout Changes(以动画的形式改变布局)
- adding animations - Animating Layout Changes
- Adding Animations之Animating Layout Changes
- Android Layout 布局动画的介绍
- Android Layout 布局动画的介绍
- 【Layout Animation 布局动画】
- zf更改layout布局文件
- OC-布局Layout、CoreAnimation层面的动画-CALayer&CAAnimation
- 动画学习2 Animating Views
- WPF的布局(Layout)
- Ext的Layout布局
- Ext的 Layout布局
- Android的布局Layout
- layout布局的学习
- Layout的存取/布局
- Android 布局动画(Layout Animations)
- 【数据库安全管理教程】oracle DB2 SQL server MySQL
- Zooming a View 缩放视图
- jquery03
- μc/GUI学习笔记之二第一个程序
- s3c6410 irom启动
- Animating Layout Changes 动画布局的更改
- 拾取之颜色编码
- 项目风险管理研究
- 拾取之检查颜色
- μc/GUI学习笔记之三文本显示与数值显示
- Win32程序开发流程
- eclipse双击变量高亮显示开关
- Struts2使用20 -- 注解配置2 -- 生命周期回调注解(拦截器注解)
- codeforces Synchrophasotron (dfs)