1.动画文件layout_animation_row_left_slide.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<layoutAnimation xmlns:android="http://schemas.android.com/apk/res/android"
android:delay="30%"
android:animation="@anim/slide_left" />
2.动画文件slide_left.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator">
<translate android:fromXDelta="100%p" android:toXDelta="0"
android:duration="@android:integer/config_shortAnimTime" />
</set>
3.
在代码中使用
LayoutAnimationController controller = AnimationUtils.loadLayoutAnimation(LinkmanActivity.this,
R.anim.layout_animation_row_left_slide);
lvLinkman.setLayoutAnimation(controller);
4.
在布局文件中使用
android:layoutAnimation="@anim/layout_animation_row_left_slide"
分享到:
相关推荐
小学四年级信息技术设置动画效果PPT教案.pptx
给Listview的Item设置动画效果,相关博文:http://www.cnblogs.com/tianzhijiexian/p/4171632.html
小学信息技术下册设置动画效果PPT教案.pptx
安卓开发时常常需要给图片设置动画效果,如缩放、旋转等,这里给出了设置的步骤和方法以及常用属性
设置动画效果教学设计.doc
设置动画效果教学设计及反思.doc
电子工业出版社小学信息技术六年级上册第二单元第七课 为幻灯片设置动画效果 优质课教学设计.pdf
设置动画效果说课稿PPT学习教案.pptx
替换PowerPoint2021已设置动画效果的图片.docx
《设置动画效果》教学设计和反思学习.doc
为幻灯片中的对象设置动画效果PPT教案.pptx
PowerPoint 2010演示文稿制作_美化幻灯片_设置动画效果.pdf 学习资料 复习资料 教学资源
动画属性( Animation ) 属性 描述 CSS @keyframes 规定动画。 3 animation 所有动画属性的简写属性,除了 animation-play- state 属性。 3 animation-name 规定 @keyframes 动画的名称。 3 animation-...
本文实例讲述了Android中ViewFlipper的使用及设置动画效果。分享给大家供大家参考,具体如下: 说到左右滑动,其实实现左右滑动的方式很多,有ViewPaer,自定义实现Viewgroup,gallery等都可以达到这种效果。这里做...
自定义对话框样式,以及对话框的加载动画,告别Android默认丑陋的对话框!
本文实例讲述了Android编程实现RotateAnimation设置中心点旋转动画效果。分享给大家供大家参考,具体如下: 在xml设置: <?xml version=1.0 encoding=utf-8?> <rotate xmlns:android=...
使用svg,js实现饼图的制作以及动画效果
5、能够设置每一个动画效果的动画类型:进入动画、表演动画、退出动画(在animate.css的源码中,opacity值从0至100的是进入动画,没有opacity属性的是表演动画。opacity值从100到0的是退出动画)。 6、实现了排版...