Android ViewFlipper的动画
首先熟悉四种动画
anim/push_up_in.xml。进入的动画
<ViewFlipper android:id="@+id/flipper" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="20dip" android:flipInterval="2000" > <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:text="@string/animation_2_text_1" android:textSize="26sp" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:text="@string/animation_2_text_2" android:textSize="26sp" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:text="@string/animation_2_text_3" android:textSize="26sp" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:text="@string/animation_2_text_4" android:textSize="26sp" /> </ViewFlipper>
// 设置退出的动画
mFlipper.setOutAnimation(AnimationUtils.loadAnimation(this,
R.anim.push_up_out));
//启动动画
mFlipper.startFlipping();
同时android.R.anim中也有几个动画slide_in_left.xml从左边进入,slide_out_right.xml