我查看了API代码中提供的过渡动画,并发现其中有zoom_enter和zoom_exit两种动画效果,其中activity 1会被隐藏进去以展示activity 2。但我需要相反的效果,也就是activity 2从内部放大并显示在上层。(希望你能明白我的意思)这种动画效果在iPhone屏幕转换时与之相同。
以下是我不需要的效果的代码。下面是zoom_enter.xml的代码:
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/decelerate_interpolator">
<scale android:fromXScale="2.0" android:toXScale="1.0"
android:fromYScale="2.0" android:toYScale="1.0"
android:pivotX="50%p" android:pivotY="50%p"
android:duration="@android:integer/config_mediumAnimTime" />
</set>
这是zoom_exit.xml的代码:
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/decelerate_interpolator"
android:zAdjustment="top">
<scale android:fromXScale="1.0" android:toXScale=".5"
android:fromYScale="1.0" android:toYScale=".5"
android:pivotX="50%p" android:pivotY="50%p"
android:duration="@android:integer/config_mediumAnimTime" />
<alpha android:fromAlpha="1.0" android:toAlpha="0"
android:duration="@android:integer/config_mediumAnimTime"/>
</set>
在调用startActivity后,我立即调用以下方法:
overridePendingTransition(R.anim.zoom_enter, R.anim.zoom_exit);
有人能提供建议,告诉我如何修改上述文件以实现我所描述的屏幕过渡效果吗?