退出动画可以设置为0, 但是两个动画的duration需要一样。
退出动画:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"$amp;>amp;$nbsp;
<translate
android:fromXDelta="0"
android:toXDelta="0"
android:fromYDelta="0"
android:toYDelta="0"
android:duration="800" /$amp;>amp;$nbsp;
</set$amp;>amp;$nbsp;
进入动画:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"$amp;>amp;$nbsp;
<translate
android:fromXDelta="-100%p"
android:toXDelta="0"
android:fromYDelta="0"
android:toYDelta="0"
android:duration="800" /$amp;>amp;$nbsp;
</set$amp;>amp;$nbsp;
写法是:
overridePendingTransition(进入动画, 退出动画);
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"$amp;>amp;$nbsp;
<translate
android:fromXDelta="0"
android:toXDelta="0"
android:fromYDelta="0"
android:toYDelta="0"
android:duration="800" /$amp;>amp;$nbsp;
</set$amp;>amp;$nbsp;
进入动画:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"$amp;>amp;$nbsp;
<translate
android:fromXDelta="-100%p"
android:toXDelta="0"
android:fromYDelta="0"
android:toYDelta="0"
android:duration="800" /$amp;>amp;$nbsp;
</set$amp;>amp;$nbsp;
写法是:
overridePendingTransition(进入动画, 退出动画);