Android ApiDemos示例解析(132):Views->Layout Animation->7. Nested Animations
2012-08-22 08:12
453 查看
android:layoutAnimation 属性定义在ViewGroup中,因此所有ViewGroup的子类都可以定义android:layoutAnimation。 ViewGroup可以嵌套定义,从而layout animation 也可以嵌套。
本例使用了TableLayout(ViewGroup的子类),其子View TableRow (也是ViewGroup的子类):
为TableLayout 定义 slide_top_to_bottom, 从上到下滑入屏幕,而TableLayout 的子ViewTableRow,每列向左滑,向右滑动交替。
本例使用了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″> <TableRow android:layoutAnimation=”@anim/layout_animation_row_right_slide”> <TextView android:gravity=”right” android:text=”@string/layout_animation_name” /> <EditText /> </TableRow> <TableRow android:layoutAnimation=”@anim/layout_animation_row_left_slide”> <TextView android:gravity=”right” android:text=”@string/layout_animation_lastname” /> <EditText /> </TableRow> <TableRow android:layoutAnimation=”@anim/layout_animation_row_right_slide”> <TextView android:gravity=”right” android:text=”@string/layout_animation_phone” /> <EditText /> </TableRow> <TableRow android:layoutAnimation=”@anim/layout_animation_row_left_slide”> <TextView android:gravity=”right” android:text=”@string/layout_animation_address” /> <EditText android:lines=”3″ /> </TableRow> </TableLayout>
为TableLayout 定义 slide_top_to_bottom, 从上到下滑入屏幕,而TableLayout 的子ViewTableRow,每列向左滑,向右滑动交替。
相关文章推荐
- Android ApiDemos示例解析(140):Views->Layouts->Baseline->Nested Example 3
- Android ApiDemos示例解析(126):Views->Layout Animation->1.Grid Fade
- Android ApiDemos示例解析(99):Views->Auto Complete->1. Screen Top
- Android ApiDemos示例解析(131):Views->Layout Animation->6. Wave Scale
- Android ApiDemos示例解析(133):Views->Layouts->Baseline->1.Top
- Android ApiDemos示例解析(194):Views->Tabs->Content By Factory
- Android ApiDemos示例解析(162):Views->Layouts->TableLayout->07. Column Collapse
- Android ApiDemos示例解析(143):Views->Layouts->LinearLayout->3. Vertical (Padded)
- Android ApiDemos示例解析(166):Views->Layouts->TableLayout->11. Gravity
- Android ApiDemos示例解析(150):Views->Layouts->LinearLayout->10. Background Image
- Android ApiDemos示例解析(191):Views->Seek Bar
- Android ApiDemos示例解析(100):Views->Auto Complete->2. Screen Bottom
- Android ApiDemos示例解析(108):Views->Controls->2. Default Theme
- Android ApiDemos示例解析(172):Views->Lists->5. Separators
- Android ApiDemos示例解析(173):Views->Lists->6. ListAdapter Collapsed
- Android ApiDemos示例解析(158):Views->Layouts->TableLayout->03.Long Content
- Android ApiDemos示例解析(139):Views->Layouts->Baseline->Nested Example 2
- Android ApiDemos示例解析(178):Views->Lists->11. Multiple choice list
- Android ApiDemos示例解析(167):Views->Layouts->TableLayout->12. Cell Spanning
- Android ApiDemos示例解析(97):Views->Animation->Push