我被困在恢复片段的动画片。我正在添加像这样的片段
A3Fragment a3Fragment = new A3Fragment();
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
transaction.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_left,
R.anim.slide_out_right, R.anim.slide_in_right);
transaction.addToBackStack(null);
transaction.replace(R.id.fragment_mainLayout, a3Fragment).commit();
但是当我执行popBackStackImmediate时,弹出的片段会被动画化。但是我无法获得接下来要显示的片段(堆栈中的片段)来制作动画。有没有办法动画这个背部片段?
答案 0 :(得分:1)
试试这个
setCustomAnimations(int enter,int exit,int popEnter,int popExit)
transaction.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_left, R.anim.slide_in_right, R.anim.slide_out_right);