【问题标题】:Android 13 when using overridePendingTransition exitAnim does not workAndroid 13 在使用 overridePendingTransition exitAnim 时不起作用
【发布时间】:2022-12-23 18:11:41
【问题描述】:

当我将设备升级到 Android 13 时,overridePendingTransition 仅适用于 enterAnim 但不适用于 exitAnim。

我的应用程序使用以下方法,Activity B 退出动画适用于除 Android 13 以外的所有操作系统版本。

活动 A -> 活动 B -> (FLAG_ACTIVITY_REORDER_TOFRONT) 活动 A

活动 B:

Intent intent = new Intent(this, A.class);
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(intent);
overridePendingTransition(0, R.anim.push_bottom_out);

活动一:

@Override
protected void onNewIntent(Intent intent) {
  super.onNewIntent(intent);
  overridePendingTransition(0, R.anim.push_bottom_out);
}

push_bottom_out.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <translate
        android:fromYDelta="0%p"
        android:toYDelta="80%p"
        android:duration="300"/>

    <alpha
        android:fromAlpha="1"
        android:toAlpha="0.3"
        android:duration="300" />
</set>

【问题讨论】:

    标签: android android-animation android-13


    【解决方案1】:

    我也有同样的问题。你找到解决办法了吗?

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-06-05
    • 2014-08-19
    • 2012-07-07
    • 1970-01-01
    • 2011-06-18
    • 1970-01-01
    相关资源
    最近更新 更多