展会信息港展会大全

Android --- layoutAnimation应用
来源:互联网   发布日期:2015-10-14 07:44:05   浏览:2103次  

导读:1.写一个left_in.xml方法[html]<?xml version="1.0" encoding="utf-8"?><translate xmlns:android="ht...

1.写一个left_in.xml方法

[html]

<?xml version="1.0" encoding="utf-8"?>

<translate xmlns:android="http://schemas.android.com/apk/res/android"

android:duration="300"

android:fillAfter="false"

android:fromXDelta="-550"

android:toXDelta="0" >

</translate>

<?xml version="1.0" encoding="utf-8"?>

<translate xmlns:android="http://schemas.android.com/apk/res/android"

android:duration="300"

android:fillAfter="false"

android:fromXDelta="-550"

android:toXDelta="0" >

</translate>

2.写一个layoutAnimation.xml方法

[html]

<?xml version="1.0" encoding="utf-8"?>

<layoutAnimation xmlns:android="http://schemas.android.com/apk/res/android"

android:animation="@anim/player_info_left_in"

android:animationOrder="normal"

android:delay="0.75" >

</layoutAnimation>

<?xml version="1.0" encoding="utf-8"?>

<layoutAnimation xmlns:android="http://schemas.android.com/apk/res/android"

android:animation="@anim/player_info_left_in"

android:animationOrder="normal"

android:delay="0.75" >

</layoutAnimation>

3.在一个拥有多行子控件的View中加载,如:

[html]

<?xml version="1.0" encoding="windows-1250"?>

<TableLayout

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:layoutAnimation="@anim/left_in_player_info_show_anim" >

<TableRow ........./>

<TableRow ........./>

<TableRow ........./>

<TableRow ........./>

<TableRow ........./>

</TableLayout>

<?xml version="1.0" encoding="windows-1250"?>

<TableLayout

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:layoutAnimation="@anim/left_in_player_info_show_anim" >

<TableRow ........./>

<TableRow ........./>

<TableRow ........./>

<TableRow ........./>

<TableRow ........./>

</TableLayout>

4.这样就能在打开上面xml页面时,逐行的按<TableRow />加载动画效果.

PS:Android提供的非常不错的功能.比使用SurfaceView实现要简单的多....

作者:bys0201

赞助本站

人工智能实验室

相关热词: android开发 教程

AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港