android:layoutAnimation 属性定义在ViewGroup中,因此所有ViewGroup的子类都可以定义android:layoutAnimation。 ViewGroup可以嵌套定义,从而layout animation 也可以嵌套。

本例使用了TableLayout(ViewGroup的子类),其子View TableRow (也是ViewGroup的子类):

<TableLayout xmlns:android=”http://schemas.android.com/apk/res/android”android:layoutAnimation=”@anim/layout_animation_table”android:animationCache=”false”android:clipToPadding=”false”android:padding=”12dp”android:layout_width=”match_parent”android:layout_height=”match_parent”android:stretchColumns=”1″><TableRowandroid:layoutAnimation=”@anim/layout_animation_row_right_slide”><TextViewandroid:gravity=”right”android:text=”@string/layout_animation_name” /><EditText /></TableRow><TableRowandroid:layoutAnimation=”@anim/layout_animation_row_left_slide”><TextViewandroid:gravity=”right”android:text=”@string/layout_animation_lastname” /><EditText /></TableRow><TableRowandroid:layoutAnimation=”@anim/layout_animation_row_right_slide”><TextViewandroid:gravity=”right”android:text=”@string/layout_animation_phone” /><EditText /></TableRow><TableRowandroid:layoutAnimation=”@anim/layout_animation_row_left_slide”><TextViewandroid:gravity=”right”android:text=”@string/layout_animation_address” /><EditText android:lines=”3″ /></TableRow></TableLayout>

为TableLayout 定义 slide_top_to_bottom, 从上到下滑入屏幕,而TableLayout 的子ViewTableRow,每列向左滑,向右滑动交替。

Layout Animation->7. Nested Animations_第1张图片" src="https://img.it610.com/image/info5/3813e5ad2d394a1984e1664c911b34f8.jpg" width="650" height="470" style="border-bottom:medium none; border-left:medium none; padding-bottom:0px; margin:5px auto; padding-left:0px; padding-right:0px; display:block; max-width:100%; height:auto; vertical-align:baseline; border-top:medium none; border-right:medium none; padding-top:0px;border:1px solid black;">


更多相关文章

  1. Android简单自定义圆形和水平ProgressBar
  2. Android(安卓)自定义TextView 实现文本间距
  3. Android(ViewPager中的ViewPager)ViewPager FragmentPagerAdapter
  4. ToggleButton自定义View学习
  5. Android中自定义switch控件样式
  6. declare-styleable中format详解
  7. android2.3 api demo 学习系列(4)--App/Activity/Custom Title
  8. android中ContactsContract获取联系人的方法
  9. Android高手进阶教程(四)之----Android(安卓)中自定义属性(attr.

随机推荐

  1. Android(安卓)带checkbox的listView 实现
  2. Android获得内/外置存储卡路径的方法
  3. Android判断现在所处界面是否为home主桌
  4. android MediaCodec ACodec OMX tips
  5. Android(安卓)aar与 jar
  6. 备忘的小知识
  7. Android中使用DownloadManager下载并安装
  8. EventThread线程对VSync的接收
  9. 在Android中借助TensorFlow使用机器学习(
  10. Tensorflow编译android平台的so库和jar包