1

我有片段在带有动画的 Activity 中转换。我注意到,当我在播放动画时按下主页按钮并使用应用程序锁定器返回时,我正在转换的片段位于新片段的顶部,并且在活动完成之前一直存在。

FragmentTransaction transaction = getSupportFragmentManager()
            .beginTransaction();
    if (addTransitionAnimation) {
        transaction.setCustomAnimations(R.anim.enter_from_right, R.anim.exit_to_left);
    }
    transaction
            .replace(R.id.instructions_content, fragment)
            .addToBackStack(null)
            .commit();
4

0 回答 0