我使用下面这些代码实现从右到左的过渡。
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="500"
android:fromXDelta="-100%"
android:toXDelta="0%" >
</translate>
</set>
和下面这些从左到右的代码
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="500"
android:fromXDelta="100%"
android:toXDelta="0%" >
</translate>
</set>`
它适用于此 overridePendingTransition(R.anim.rtol, R.anim.ltor);
但是,它在进行过渡时显示黑屏并且不流畅。 任何有用的答案将不胜感激。
最佳答案
您是否尝试过 android 默认的 Transitions
,它们已经在 android 中可用。
例如
@android:anim/slide_in_left
和
@android:anim/slide_out_right
关于android - 需要Android Activity 从右到左过渡的帮助,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30502577/