name="android:activityOpenEnterAnimation">@anim/slide_in_right name="android:activityOpenExitAnimation"_activity 左进动画">
赞
踩
为保证每一页面都是左进右出所以在style指定
1.
<style name="activityAnimation" parent="@android:style/Animation"> <item name="android:activityOpenEnterAnimation">@anim/slide_in_right</item> <item name="android:activityOpenExitAnimation">@anim/slide_out_left</item> <item name="android:activityCloseEnterAnimation">@anim/slide_in_left</item> <item name="android:activityCloseExitAnimation">@anim/slide_out_right</item> </style>
1.activityOpenEnterAnimation:档activity打开时候的动画
2.activityOpenExitAnimation:当activity没有销毁时的退出动画
3.activityCloseEnterAnimation:当activity消失下一界面进入的效果
4.activityCloseExitAnimation:当activity销毁时的动画
2.创建动画
1.slide_in_right
<set xmlns:android="http://schemas.android.com/apk/res/android" > <translate android:duration="100" android:fromXDelta="-100.0%p" android:toXDelta="0.0" /> </set>
2.slide_in_right
<set xmlns:android="http://schemas.android.com/apk/res/android" > <translate android:duration="100" android:fromXDelta="100.0%p" android:toXDelta="0.0" /> </set>
3.slide_out_left
<set xmlns:android="http://schemas.android.com/apk/res/android" > <translate android:duration="100" android:fromXDelta="0.0" android:toXDelta="-100.0%p" /> </set>
4.slide_out_right
<set xmlns:android="http://schemas.android.com/apk/res/android" > <translate android:duration="100" android:fromXDelta="0.0" android:toXDelta="100.0%p"/> </set>
5.ok,可以测试运行下跳转activity
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。