这是activity中的代码: Intent intent=Intent(MainActivity.,MainActivity2.); startActivity(intent); overridePendingTransition(R.anim.,R.anim.); ; 这是xml配置文件: zoom_in.xml: <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/decelerate_interpolator" > <scale android:duration="1000" android:fromXScale="0.1" android:fromYScale="0.1" android:pivotX="50%" android:pivotY="50%" android:toXScale="1.0" android:toYScale="1.0" /> <alpha android:duration="1000" android:fromAlpha="0" android:toAlpha="1.0" /> </set> zoom_out.xml: <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/decelerate_interpolator" android:zAdjustment="top" > <scale android:duration="1000" android:fromXScale="1.0" android:fromYScale="1.0" android:pivotX="50%p" android:pivotY="50%p" android:toXScale="0.5" android:toYScale="0.5" /> <alpha android:duration="1000" android:fromAlpha="1.0" android:toAlpha="0" /> </set>
相关分类