Menu Home

viewgroup

Android: 对ViewGroup使用补间动画

res/anim/layout_anim.xml <?xml version=”1.0″ encoding=”utf-8″?> <layoutAnimation xmlns:android=”http://schemas.android.com/apk/res/android” android:delay=”0.5″ android:animationOrder=”random” android:animation=”@anim/popin”/> res/anim/popin.xml <?xml version=”1.0″ encoding=”utf-8″?> <set xmlns:android=”http://schemas.android.com/apk/res/android” android:interpolator=”@android:anim/accelerate_interpolator” > <scale android:duration=”2000″ android:fromXScale=”0.0″ android:fromYScale=”0.0″ android:pivotX=”50%” android:pivotY=”50%” android:toXScale=”1.0″ android:toYScale=”1.0″ /> </set> res/layout/activity_main.xml <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” android:layout_width=”match_parent” android:layout_height=”match_parent” android:layoutAnimation=”@anim/layout_anim” android:paddingBottom=”@dimen/activity_vertical_margin” android:paddingLeft=”@dimen/activity_horizontal_margin” android:paddingRight=”@dimen/activity_horizontal_margin” android:paddingTop=”@dimen/activity_vertical_margin” tools:context=”.MainActivity” > <TextView android:id=”@+id/t1″ android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”@string/hello_world” /> <TextView android:id=”@+id/t2″ android:layout_width=”wrap_content” android:layout_height=”wrap_content” […]